Styles can be inherited from a type.
Define the type that an item inherits from in the type property.
See also:
import { createTimeline } from "kronograph";
import data from "./data";
const timeline = createTimeline("my-timeline");
timeline.set(data);
timeline.fit(); export default {
entityTypes: {
person: {
color: "#0286F2",
labelColor: "#EEEEEE",
lineWidth: 12,
typeLabel: "People",
},
company: {
color: "#E9B628",
labelColor: "#FDCA40",
lineWidth: 2,
typeLabel: "Companies",
},
},
eventTypes: {
email: {
lineWidth: 2,
},
phoneCall: {
lineWidth: 6,
showArrows: false,
},
},
entities: {
"smith-johnathan-151": {
label: "John Smith",
type: "person",
},
"west-josephine-126": {
label: "Josephine West",
type: "person",
},
"roberts-nathaniel-023": {
label: "Nathan Roberts",
type: "person",
},
company0375: {
label: "Leffler Inc.",
type: "company",
},
company1846: {
label: "EDI Group",
type: "company",
},
},
events: {
"email 1": {
entityIds: ["smith-johnathan-151", "company0375"],
type: "email",
time: new Date(2026, 9, 14),
},
"email 2": {
entityIds: ["west-josephine-126", "company0375"],
type: "email",
time: new Date(2026, 3, 15),
},
"email 3": {
entityIds: ["roberts-nathaniel-023", "company0375"],
type: "email",
time: new Date(2027, 7, 16),
},
"call 1": {
entityIds: ["west-josephine-126", "company0375"],
type: "phoneCall",
time: new Date(2027, 10, 14),
},
"email 4": {
entityIds: ["roberts-nathaniel-023", "company0375"],
type: "email",
time: new Date(2026, 12, 12),
},
"email 5": {
entityIds: ["smith-johnathan-151", "company0375"],
type: "email",
time: new Date(2028, 3, 15),
},
"email 6": {
entityIds: ["smith-johnathan-151", "company1846"],
type: "email",
time: new Date(2025, 9, 14),
},
"call 2": {
entityIds: ["west-josephine-126", "company1846"],
type: "phoneCall",
time: new Date(2025, 12, 15),
},
"email 7": {
entityIds: ["roberts-nathaniel-023", "company1846"],
type: "email",
time: new Date(2028, 2, 16),
},
"email 8": {
entityIds: ["west-josephine-126", "company1846"],
type: "email",
time: new Date(2026, 2, 24),
},
"email 9": {
entityIds: ["roberts-nathaniel-023", "company1846"],
type: "email",
time: new Date(2028, 6, 16),
},
"email 10": {
entityIds: ["smith-johnathan-151", "company1846"],
type: "email",
time: new Date(2028, 7, 12),
},
},
}; <!doctype html>
<html>
<head>
<link rel="stylesheet" href="@ci/theme/kg/css/examples.css" />
</head>
<body>
<div id="my-timeline" style="height: 100vh"></div>
<script type="module" src="./code.js"></script>
</body>
</html> import React from "react";
import { createRoot } from "react-dom/client";
import Timeline from "kronograph/react/Timeline";
import data from "./data";
export const Demo = () => (
<Timeline
entityTypes={data.entityTypes}
eventTypes={data.eventTypes}
entities={data.entities}
events={data.events}
/>
);
const root = createRoot(document.getElementById("my-timeline"));
root.render(<Demo />); export default {
entityTypes: {
person: {
color: "#0286F2",
labelColor: "#EEEEEE",
lineWidth: 12,
typeLabel: "People",
},
company: {
color: "#E9B628",
labelColor: "#FDCA40",
lineWidth: 2,
typeLabel: "Companies",
},
},
eventTypes: {
email: {
lineWidth: 2,
},
phoneCall: {
lineWidth: 6,
showArrows: false,
},
},
entities: {
"smith-johnathan-151": {
label: "John Smith",
type: "person",
},
"west-josephine-126": {
label: "Josephine West",
type: "person",
},
"roberts-nathaniel-023": {
label: "Nathan Roberts",
type: "person",
},
company0375: {
label: "Leffler Inc.",
type: "company",
},
company1846: {
label: "EDI Group",
type: "company",
},
},
events: {
"email 1": {
entityIds: ["smith-johnathan-151", "company0375"],
type: "email",
time: new Date(2026, 9, 14),
},
"email 2": {
entityIds: ["west-josephine-126", "company0375"],
type: "email",
time: new Date(2026, 3, 15),
},
"email 3": {
entityIds: ["roberts-nathaniel-023", "company0375"],
type: "email",
time: new Date(2027, 7, 16),
},
"call 1": {
entityIds: ["west-josephine-126", "company0375"],
type: "phoneCall",
time: new Date(2027, 10, 14),
},
"email 4": {
entityIds: ["roberts-nathaniel-023", "company0375"],
type: "email",
time: new Date(2026, 12, 12),
},
"email 5": {
entityIds: ["smith-johnathan-151", "company0375"],
type: "email",
time: new Date(2028, 3, 15),
},
"email 6": {
entityIds: ["smith-johnathan-151", "company1846"],
type: "email",
time: new Date(2025, 9, 14),
},
"call 2": {
entityIds: ["west-josephine-126", "company1846"],
type: "phoneCall",
time: new Date(2025, 12, 15),
},
"email 7": {
entityIds: ["roberts-nathaniel-023", "company1846"],
type: "email",
time: new Date(2028, 2, 16),
},
"email 8": {
entityIds: ["west-josephine-126", "company1846"],
type: "email",
time: new Date(2026, 2, 24),
},
"email 9": {
entityIds: ["roberts-nathaniel-023", "company1846"],
type: "email",
time: new Date(2028, 6, 16),
},
"email 10": {
entityIds: ["smith-johnathan-151", "company1846"],
type: "email",
time: new Date(2028, 7, 12),
},
},
}; <!doctype html>
<html>
<head>
<link rel="stylesheet" href="@ci/theme/kg/css/examples.css" />
</head>
<body>
<div id="my-timeline" style="height: 100vh"></div>
<script type="module" src="./code.jsx"></script>
</body>
</html>