How to create a composite caption on Neo4j Grass style file? - neo4j

For example,
"node.Person": {
"color": "#FF756E",
"border-color": "#E06760",
"text-color-internal": "#FFFFFF",
"caption": "{name}"
}
I want the "Person" to be displayed as the label of the node, and "name" and "age" to be displayed as the attributes of the node. Currently, only 'name' is displayed as the caption.
How to change the code above?
EDITED:
Neo4j people, how did you generate the graphs in the book? Thank you. This is one example below.

You can do it by editing the styles. Do this by typing ":style" to the neo browser UI, copy-paste the styles to text editor and just add the fields to the caption in curly brackets e.g.
"node.Person": {
"defaultCaption": "<id>",
"diameter": "50px",
"color": "#A5ABB6",
"border-color": "#9AA1AC",
"text-color-internal": "#FFFFFF",
"caption": "{name} {age}"
}
Would result in showing Person entities with name and age on them.

As I said in the comments of my answer its not possible. My anwser is as close as you can get. "node.MESSAGE": { "caption":"Message name:{NAME}" }. You can only write directly onto the node. I recommend to use different colours for different labels

Related

Onchange update second subcomponent

I have a file that is used to store all my colour choice, I bring the colour choices that I need into a part file using the Subcomponents (Supersedings)
{
"internalId": "externalCubbyCoverColourRack",
"componentId": "racksystems_test:sub_mfccolours",
"numberInPartList": "0",
"active": "version=='Rack'",
"supersedings": [
{
"type": "parameter",
"key": "cubbyCoverColourRack"
}
]
}, {
"internalId": "externalCubbyColourRack",
"componentId": "racksystems_test:sub_mfccolours",
"numberInPartList": "0",
"active": "version=='Rack'",
"supersedings": [
{
"type": "parameter",
"key": "cubbyColourRack"
}
]
},
I have 2 colours that I bring in that are a Main Colour and a Cover Colour, when the main colour is selected it changes the Main Colour and I want it to change the Cover Colour too but if you change the Cover Colour only the cover colour changes. Is this possible to do with a KEY that's used from Subcomponents?
Normally, it is recommended to use parameter onValueChange script. However, this is intended to work in a scope of a single component.
From your code, I think it should be possible to supersede both of them from a single subComponent instance. Then you can link the two parameters somehow in the sub_mfccolours itself, using parameter onValueChange script.
It is important to know, that every subComponent instance is its own component with its own internal data. If you have a reason to have two subComponents like this, it might help to add assignment "cubbyColourRack": "cubbyColourRack" to the externalCubbyCoverColourRack subComponent.

UpdateTextStyle Request Clearing Bold When Setting fontFamily

I am trying to update the font of a range of text in a Google Docs document using the API. I am trying to change just the font and not the font size or style attributes like bold or italic. So if for example I have a document with just the text below as the content:
Hello world
I want to change just the font for the word Hello but leave it the same size and still bold and italic.
I tried to accomplish this with the following code documents.batchUpdate request
{
"requests": [
{
"updateTextStyle": {
"range": {
"startIndex": 1,
"endIndex": 6
},
"textStyle": {
"weightedFontFamily": {
"fontFamily": "Times New Roman"
}
},
"fields": "weightedFontFamily"
}
}
]
}
The result is a successful response from the server but when I check the document I see it changed the font keeping the size and italic attribute, but it didn't keep the bold attribute. I have also tried this using the Google API Explorer and can reproduce the same results.
My question is how do I change the font without loosing the bold? It seems like it should be possible as it kept the italic attribute in tact. Why is bold different? Is it a bug?
My goal is to just change the font leaving the other attributes as is so I do not want to set bold or other attributes explicitly. I also don't want to have to determine the attributes before hand and reset them. That is more work and will be slower and shouldn't be necessary if italic is maintained.
I am able to do something very similar without issue in Google Sheets using a repeatCell.cell.userEnteredFormat.textFormat.fontFamily request and it maintains the bold and italic.
Thanks in advance for any insight or help.
How do I change the font without loosing the bold?
Answer
You have to first save the font weight and bold settings for the range of text you want to modify. There may be more then one font setting for the range. To get the font weight and bold settings for the range you must first check textRun.textStyle. If not defined there you must lookup the paragraphs namedStyleType and check it for the weight and bold settings. If not defined there you must check the NORMAL_TEXT namedStyleType. If not defined there you must use the Google Docs editor default value which for weight is 400 and bold is false.
Once you have the font info for the range you make make a requests for each different font. The request would be like the one in the original question but would set the weightedFontFamily.weight and the bold attributes based on the saved font info.
{
"requests": [
{
"updateTextStyle": {
"range": {
"startIndex": 1,
"endIndex": 6
},
"textStyle": {
"weightedFontFamily": {
"fontFamily": "Times New Roman"
"weight": savedWeight
},
"bold": savedBold
},
"fields": "weightedFontFamily"
}
}
]
}
Why is bold different?
Answer
The Google Docs API uses weightedFontFamily where the weight sub-attribute defaults to 400 and not the current font weight. The bold setting just increases the weight, so bold and weight are linked. There is no current way in the API to set just the font leaving weight/bold alone.
Is it a bug?
Answer
Based on a reply from #Tanaike I have reported the issue to Google via the Google Issue Tracker (https://issuetracker.google.com/165029692). They informed me it was working as intended.

Customize color of text inside `backquotes` in VSCode

The only options I can find that deal with custom coloring inside Visual Studio Code are those:
"editor.tokenColorCustomizations": {
"[Atom One Dark]": {
"comments": "#FF0000" // only 6 color-customizable
},
"workbench.colorCustomizations": {
"statusBar.background": "#666666",
"panel.background": "#555555",
"sideBar.background": "#444444"
},
},
Is there a way to set a custom color for these types of things? One exists for comments, for strings (inside "string"). I believe something similar should be possible for other stuff using regexps. Thanks in advance.
Search for tokenColorCustomizations and textMateRules and you will find that you can do something like this (see colorizing with textmate):
"editor.tokenColorCustomizations": {
"textMateRules": [
{
// works for a language that recognizes backticks as string templates
"scope": "string.template",
"settings": {
"foreground": "#FF0000"
}
},
{
"scope": "punctuation.definition.template-expression.begin, punctuation.definition.template-expression.end",
"settings": {
"foreground": "#F0F"
}
},
]
}
using the Inspect TM Scopes... command in the command palette. So I used that command to click inside a template literal and got the string.template.js.jsx scope. But that didn't change the ${someVar} so I inspected that scope and saw variable.other.readwrite.js.jsx plus additional scope parameters - still working on isolating that kind of a variable from other variables.
Edit: Should work in more file types by using only string.template, if the language treats backticks as a string template.
You can also change the fontStyle within a setting. There are a few answers here about using the TM Scopes command.

Umbraco - Add spacing under element

The question might seem stupid. but i really can't find what i should type on the "Add spacing under element" text box to achieve the spacing from the CMS and not hard-coded.
In an element properties you can see this window:
Umbraco version 7.2.5 assembly: 1.0.5610.18894
Free License for now but planning to get one this week.
Okay I got your point. You are using Grid Layout.
By default Umbraco Grid layout datatype have setting class and styling background image as below
This can be found in Developer -> Datatypes - > datatype you have created with "Grid Layout", You can find data type name in Setting->Document types -> Name of home doc type -> generic properties
You can change settings and styles by clicking edit, it contains json data as below. This is default value
For setting
[
{
"label": "Class",
"description": "Set a css class",
"key": "class",
"view": "textstring"
}
]
For Style
[
{
"label": "Set a background image",
"description": "Set a row background",
"key": "background-image",
"view": "imagepicker",
"modifier": "url({0})"
}
]
Get full details on link
Now your scenario.
I think according to description, you have used this to add padding-bottom or margin-bottom style on the element. So you must use values like "20px" or "10px". Try only numbers like "10" if this don't work

How to change the color of jqGrid cell?

I use the following line at the $(document).ready(
$("#stSearchTermsGrid").setCell(2, 2, '', {color:'red'}) ;
but it doesn't work. Did I write it in a wrong way or placed it in the wrong place.
I know this question has been asked more than once before and this is how I got the first line. But I am still not able to do it and not knowing where the problem is.
You are right you are not the first person who ask the question. To clear the situation with the cell color I made the demo
for you which change the text color of the cell or the background color of the sell in different ways:
loadComplete: function() {
// 2 is zero-base index of the column 'name' ('Client'). Every from the options
// multiselect:true, rownumbers:true and subGrid:true will increase
// the index by 1 because the option inserts additional columns
$("#6 td:eq(2)", grid[0]).css({color:'red'});
grid.jqGrid('setCell',"12","name","",{color:'red'});
grid.jqGrid('setCell',"10",'name', '', 'my-highlight');
grid.jqGrid('setCell',"8",'name', '', 'ui-state-error ui-state-error-text');
grid.jqGrid('setCell',"4","name","",{'background-color':'yellow',
'background-image':'none'});
grid.jqGrid('setCell',"3","name","",'ui-state-highlight');
}
where
<style type="text/css">
.my-highlight { color: red; }
</style>
and "3", "4", "6", "8", "10" and "12" are th rowid of the rows where the color of the corresponding column will be changed.
By the way my personal favorites are the ways using 'ui-state-highlight' or 'ui-state-error ui-state-error-text' classes which are the part of the jQuery UI Themes.
UPDATED: To understand the difference of the usage of different methods in case of the usage of another jQuery UI Theme I added one more demo used La Frog Theme where the same table as above look like the following:

Resources