-
Notifications
You must be signed in to change notification settings - Fork 1
Themes
A theme in Grapholscape is a set of colours applied to the UI widgets and to the graph.
-
UI colours
-
primary
: used mainly for widgets surface colour -
on-secondary
: used for text on a surface havingprimary
colour as background -
primary-dark
andon-primary-dark
: used for convey lower z-levels -
secondary
: used as contrast to the primary for highlighting interactive objects and headers -
on-secondary
: used for text on a surface havingsecondary
colour as background -
secondary-dark
andon-secondary-dark
: used for convey lower z-levels -
shadows
: used for shadows and borders -
error
: used for error messages -
on-error
: used for text on surfaces havingerror
as background colour
-
-
Graph colours
-
background
: canvas background -
edge
: edges colour -
node-bg
: default nodes background colour -
node-bg-contrast
: used for nodes that are black in the black/white version of Graphol (i.e. range restrictions) -
node-border
: border colours for nodes -
label-colour
: colour for labels -
label_colour_contrast
: colour for labels opposite to the previous one [not used]
-
-
Entities colours (optional)
-
role
: used on object properties nodes as background, -
role_dark
: as border and edges of type role in simplified modes -
attribute
: used on data properties nodes as background -
attribute_dark
: as border and edges of type attribute in simplified modes -
concept
: used on classes nodes as background -
concept_dark
: as border -
individual
: used on individual nodes as background -
individual_dark
: as border
-
It is possible to choose the default theme among the predefined ones or defining a custom one. In both cases it is necessary to specify it in the custom default settings. read more about default settings customization.
Simply specify the name of the predefined theme in custom settings at the key theme
.
const defaultSettings = {
theme : 'dark'
}
const grapholscape = new Grapholscape(grapholFile, container, defaultSettings)
grapholscape.then( ... )
Predefined Themes : gscape
, dark
, classic
It is possible to define new theme specifying each colour in the custom settings at the theme
entry.
This time the value will not be a string
but an object
whose properties are the colours with their values.
The new theme will be based on the light
theme of Grapholscape, this means that all unspecified colours will not be overwritten.
You can use two special keys:
-
name
(String
): the name that will be displayed to the user in the setting panel.Default:
name = Custom[i]
where[i]
is a number -
selected
(Boolean
): for telling Grapholscape whether to apply the theme or not, if false it will be defined and registered in themes list and the user can select it in setting panel.Default:
selected = true
const defaultSettings = {
theme : {
secondary : 'red',
name: 'Red Passion Theme',
selected: true
}
}
const grapholscape = new Grapholscape(grapholFile, container, defaultSettings)
grapholscape.then( ... )