Skip to content

Commit 437811c

Browse files
committed
Clarification on styling the visualization.
1 parent 3c572a2 commit 437811c

2 files changed

Lines changed: 26 additions & 6 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ The library is available through Maven Central. The coordinates are:
2929
</dependency>
3030
```
3131

32-
You should be able to use the artifact with Maven and Gradle projects with little effort.
32+
:warning: But please note that the files `smartgraph.css` and `smartgraph.properties` **must be added manually** to your project.
33+
34+
:bulb: You should be able to use the artifact with Maven and Gradle projects with little effort.
3335

3436
### Accelerated graphics
3537

smartgraph.css

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
/*
2-
STYLESHEET FOR JAVAFXGRAPH VISUALIZATION
2+
STYLESHEET FOR SMARTGRAPH VISUALIZATION.
3+
4+
For your customization, please see:
5+
https://openjfx.io/javadoc/19/javafx.graphics/javafx/scene/doc-files/cssref.html
6+
7+
And know that:
8+
- The drawing area itself is of type Pane, which is an extension of Region;
9+
- A vertex is of type Circle;
10+
- The edges are of type Line and CubicLine;
11+
- The labels are of type Text, and;
12+
- The arrows are of type Path.
13+
14+
This should help you understand which styles you can apply.
315
*/
416

517
.graph {
6-
-fx-background-color: #F4FFFB;
18+
-fx-background-color: #F4FFFB;
19+
/* you can use -fx-background-image to set a background image */
720
}
821

922
.vertex {
@@ -13,15 +26,20 @@ STYLESHEET FOR JAVAFXGRAPH VISUALIZATION
1326
-fx-fill: #B1DFF7;
1427
}
1528

29+
.vertex:hover { /* pseudo-classes also work */
30+
/*-fx-cursor: default; */ /* You can use this style to override the hand/move cursors while hovering. */
31+
-fx-stroke-width: 4;
32+
}
33+
1634
.vertex-label {
1735
-fx-font: bold 8pt "sans-serif";
1836
}
1937

2038
.edge {
2139
-fx-stroke-width: 2;
2240
-fx-stroke: #FF6D66;
23-
-fx-stroke-dash-array: 2 5 2 5; /* remove for clean edges */
24-
-fx-fill: transparent; /*important for curved edges */
41+
-fx-stroke-dash-array: 2 5 2 5; /* remove for clean lines */
42+
-fx-fill: transparent; /* important to keep for curved edges */
2543
-fx-stroke-line-cap: round;
2644
-fx-opacity: 0.8;
2745
}
@@ -39,7 +57,7 @@ STYLESHEET FOR JAVAFXGRAPH VISUALIZATION
3957
/* Custom vertex. You should revert any unwanted styling in the default element,
4058
style, since custom styles will be appended to the default style */
4159
.myVertex {
42-
-fx-stroke-width: 5;
60+
-fx-stroke-width: 4;
4361
-fx-stroke: green;
4462
-fx-stroke-type: inside; /* you should keep this if using arrows */
4563
-fx-fill: yellowgreen;

0 commit comments

Comments
 (0)