lotivis-colors v1.0.0
lotivis-colors 
Colors for lotivis.js.
let data = [ /* */ ];
let colorsGenerator = lotivis.colorsGenerator(data);
let labelColor = colorsGenerator.label("label-1");
Installing
If you use npm, npm install lotivis-colors
. You can also download the latest realease on GitHub. For using in browsers, you can load the UMD bundle from an npm-based CDN such as jsDelivr.
<script src="https://cdn.jsdelivr.net/..."></script>
<script>
let dataController = lotivis.dataController();
</script>
API Reference
Colors Generator
let data = [ /* */ ];
let colorsGenerator = lotivis.colorsGenerator(data);
// receive color for a specific label
let labelColor = colorsGenerator.label("label-1");
// receive color for a specific group
let groupColor = colorsGenerator.group("group-1");
// change data of generator
colorsGenerator.data(otherData);
// change color scheme of generator
colorsGenerator.colorScheme(lotivis.colorSchemeTableau10);
colorsGenerator.data(_)
Gets or sets the generators data.
colorsGenerator.colorScheme(_)
Gets or sets the generators color scheme.
colorsGenerator.group(group)
Returns the color for the specified group
.
colorsGenerator.label(label)
Returns the color for the specified label
.
Color Scales
lotivis.colorScale(...colors)
Returns a generated color scale from the specified colors.
lotivis.colorScale1
Colro scale with "Yellow", "Orange", "Red" and "Purple".
lotivis.colorScale2
Color scale with "White", colorSchemeDefault2 and colorSchemeDefault0.
Color Schemes
A color scheme is an array of HTML colors.
lotivis.colorSchemeLotivis10
[
"RoyalBlue",
"MediumSeaGreen",
"MediumPurple",
"Violet",
"Orange",
"Tomato",
"Turquoise",
"LightGray",
"Gray",
"BurlyWood",
]
lotivis.colorSchemeCategory10
Copy of d3.schemeCategory10
.
lotivis.colorSchemeTableau10
Copy of d3.colorSchemeTableau10
.
lotivis.colorSchemeDefault
Copy of colorSchemeCategory10
.
lotivis.tintColor
Holds the first color of th default color scheme (colorSchemeDefault
).
Development`
# build module
yarn build
# develop module
yarn build:watch
3 years ago