Styling graphs in Memgraph Lab - graph-databases

When I generate graph using Memgraph Lab I get something that looks like this:
I would like to change the styling of nodes and relationships. How can I do that?

Memgraph Lab uses Graph Style Script language for styling. You can use EdgeStyle directive properties and NodeStyle directive properties to style your graph.
For example, you can change the color and size of nodes with the following code:
#NodeStyle {
size: 35
border-width: 5
border-color: #ffffff
shadow-color: #333333
shadow-size: 20
}
With the following code you will change the visual representation of relationships:
#EdgeStyle {
width: 1
label: Type(edge)
arrow-size: 0
color: #6AA84F
}

Related

Codename One - transparent foreground and fonts

I have not yet found any option to provide transparency to the foreground color of a component, or to the font for that matter.
What I want to do is:
Label halfTransparentLabel = new Label("Half Transparent text");
Style s = halfTransparentLabel.getAllStyles();
s.setBgColor(0);
s.setBgTransparency(255);
s.setFgColor(0xffffff);
s.setFgTransparency(128); // this method does not exist
I know drawing translucent stuff is heavy on the performance, but I want to do it on particular pieces only. would greatly improve the visual appeal and design, having this option.
Can this be worked around?
UPDATED ANSWER
Thanks to the Shai's comment, I update my answer. The workaround I suggested is not necessary. The same result of the posted screenshot can be obtained with https://www.codenameone.com/javadoc/com/codename1/ui/plaf/Style.html#setOpacity-int- or with the opacity property in the CSS, for example:
BigLabel {
font-size: 6mm;
font-family: "native:MainRegular";
color: red;
background-color: transparent;
opacity: 0.5;
}
OLD ANSWER - Yes, it's possible to workaround this problem using the .toImage() method, as in this screenshot:
I'm not sure if this workaround is the best, however it works.
The code of this example:
Form hi = new Form("Semitransparent Example", BoxLayout.y());
hi.getToolbar().setUIID("Transparent");
hi.setUIID("FormBackground");
Container cnt = FlowLayout.encloseIn(new Label("Half Transparent Text", "BigLabel"));
// .setSize() and .revalidate(), in this case, are necessary to use the .image() method
cnt.setSize(new Dimension(hi.getContentPane().getWidth(), CN.convertToPixels(8, false)));
cnt.revalidate();
hi.add(cnt.toImage().modifyAlpha((byte) 125));
hi.show();
and the CSS:
#Constants {
includeNativeBool: true;
}
Transparent {
background-color: transparent;
}
FormBackground {
background-image: url("background.jpg");
}
BigLabel {
font-size: 6mm;
font-family: "native:MainRegular";
color: red;
background-color: transparent;
}
thanks for your answers. with the above tips, the easiest solution in code is the following:
component.getAllStyles().setOpacity(128);
so what is the benefit to use CSS?
Having the designer to all the formating and styling, I already hate to do some parts in code and some in the designer. So why make it even more complex by introducing CSS? is CSS support supposed to replace the designer?

Print entire page with graph using CTRL+P

I'm trying to print the entire page with graph using CTRL + P, but the graph is always cropped.
I tried to limit the width of the graph using CSS media = "print", but it seems to have no effect on the graph.
print.css
figure{
width: 100% !important;
/* width: 300px !important; //also does not work */
}
If I try to change the size of the graph in CSS media = "screen", the graph will immediately shrink / enlarge.
I know there is a function chart.print(); But it only prints the graph. I need to print the entire page, including the graph. I tried it in Chrome 73. Anychart 8.5.1

How to prevent visual studio code from putting line breaks in my JSX?

I'm trying to set up my visual studio code to clean up or beautify my JSX/JS when coding in React.
I have several prettier formatting plugins installed. When I do 'Format Document', it makes my code look horrible.
Something nice like this:
<Map
style={{
height: "100%",
width: "100%",
margin: "0 auto"
}}
center={position}
zoom={10}>
turns into junk like this...
return ( <
Map style = {
{
height: "100%",
width: "100%",
margin: "0 auto"
}
}
center = {
position
}
zoom = {
10
} >
<
I've searched through many settings files...what is controlling this? I turned on Prettier: Jsx Bracket Same Line to be true. I set the character width to be wide. I turned off any line break things. I honestly have no idea why it's making my jsx look horribly unreadable. When I drop this same code into https://prettier.io/playground, it looks fine coming out.
What setting is putting my code onto separate lines?
This can be solved by changing the Select Language Mode from JavaScript to Javascript React in your Visual Studio code editor

Mixing id- and class-selectors in CSS with JavaFX 8

Is there a way to make class- and id-selectors work together in JavaFX 8?
E.g.: I´d like to style a progressbar the following way:
.myprogressbar #greenBar .bar {
-fx-background-color: green;
}
This solution used to work before JavaFX 8.
Your css selector is matching a Node with class "bar" which is a descendant of a Node with id "greenBar" which in turn is a descendant of a Node with class "myprogressbar".
I assume you're setting the class "myprogressbar" and the id "greenBar" on the same node (a ProgressBar). To match this, you need to remove the space between .myprogressbar and #greenBar:
.myprogressbar#greenBar .bar {
-fx-background-color: green;
}
If you want to set a css style by id but just for a part of a node, the following code snippet did the trick for me:
In my css stylesheet file I defined this:
#agile-board *.split-pane-divider {
-fx-background-color: #C9C9C9;
-fx-border-style: dashed;
-fx-border-width: 1px;
}
In my class where I wanted to use this style I did this:
this.board = new SplitPane();
this.board.setId("agile-board");
The node got the style wit the id #agile-board applied but just the divider of that SplitPane.
Good programming :-)

How to display an ExtJS window with a different colour

I need to display a window Ext.Window with a colour different to that of the default theme.
Changing the colour of the guts of the window is easy enough. Changing the colour of the chrome of all popup windows is also very easy. Changing the chrome of a single window seems extremely hard. Best as I can tell, you need to copy all the styles (x-window and similar), rename and customise them and set the baseCls of the window.
Is there an easier way to do this?
In configs for the window ...
bodyCls: 'popWindow',
and then somewhere in a css
.popWindow
{
background-color: blue;
}
You can add your own custom class to the window, then write CSS rules for that class.
Check out the cls config option or the addCls method on Ext.Window. Try it out, then inspect the class applied to your window to figure out where to apply your CSS rules.
Here's the doc for Ext.Window. In Ext 3.x, I believe the method is addClass. But the config option was still cls (I think).
Sorry to answer my own question, but I finally worked out a way to colour a single window in isolation of other windows. Initially I thought I was going to have to clone the entire x-window set of classes and modify the clone but I have since found an easier way to do it.
I got a lot of help from this link but also used a lot of trial an error as my CSS skills suck
You'll need to clone and edit the background images used by
the overriding css. The files you'll need are top-bottom.png, left-right.png, left-corners.png, right-corners.png and tool-sprites.gif
The window that you wish to colour needs to have an id ('defn_display' in this
example).
Set the bodyCls of the window to a separate class that sets the background colour. For example:
.defn_content
{
background: #FFFFDD !important;
}
You need to set up the css class selectors to override the
x-window classes based upon this id using the new images cloned in step 1.
#defn_display * .x-window-tc {
background-image: url("/static/images/defn-top-bottom.png");
}
#defn_display * .x-window-ml {
background-image: url("/static/images/defn-left-right.png");
}
#defn_display * .x-window-mr {
background-image: url("/static/images/defn-left-right.png");
}
#defn_display * .x-window-tl {
background-image: url("/static/images/defn-left-corners.png");
}
#defn_display .x-window-tl {
background-image: url("/static/images/defn-left-corners.png");
}
#defn_display * .x-window-bl {
background-image: url("/static/images/defn-left-corners.png");
}
#defn_display * .x-window-tr {
background-image: url("/static/images/defn-right-corners.png");
}
#defn_display * .x-window-br {
background-image: url("/static/images/defn-right-corners.png");
}
#defn_display * .x-window-bc {
background-image: url("/static/images/defn-top-bottom.png");
}
#defn_display .x-tool {
background-image: url("/static/images/defn-tool-sprites.gif");
}
#defn_display * .x-window-header-text {
color: #515111;
}
The CSS seems to do the trick with one exception: the drag ghost is tricky to override since it is not a child of the window. As such, I still get a blue ghost during dragging.
(Tested under FF, Chrome and IE6 with ExtJs 3.4)
Check the ui property. I never tried it by myself, but I heard on Sencha conference that it's possible. Good luck...

Resources