Search

Emojis

Entities

Use emoji characters in your timeline.

Emojis
View live example β†’

Add emojis to your timeline using the fontIcon object within the glyphs object.

See also:

import { createTimeline } from "kronograph";
import { entities, events } from "./data";

const timeline = createTimeline("my-timeline");

timeline.set({
  entities,
  events,
});
timeline.fit();
const transparent = "rgba(0, 0, 0, 0)";
const entityFontIconScale = 2;

const flagEmojis = {
  UK: "πŸ‡¬πŸ‡§",
  USA: "πŸ‡ΊπŸ‡Έ",
  Spain: "πŸ‡ͺπŸ‡Έ",
  Japan: "πŸ‡―πŸ‡΅",
  Brazil: "πŸ‡§πŸ‡·",
};

export const entities = {
  UK: {
    label: "United Kingdom",
    color: "#15cad5",
    glyph: {
      color: transparent,
      fontIcon: {
        fontFamily: "sans-serif",
        text: flagEmojis.UK,
        scale: entityFontIconScale,
      },
    },
  },
  USA: {
    label: "United States",
    color: "#e12d39",
    glyph: {
      color: transparent,
      fontIcon: {
        fontFamily: "sans-serif",
        text: flagEmojis.USA,
        scale: entityFontIconScale,
      },
    },
  },
  Spain: {
    label: "Spain",
    color: "#f7d06e",
    glyph: {
      color: transparent,
      fontIcon: {
        fontFamily: "sans-serif",
        text: flagEmojis.Spain,
        scale: entityFontIconScale,
      },
    },
  },
  Japan: {
    label: "Japan",
    color: "#f9f9f9",
    glyph: {
      color: transparent,
      fontIcon: {
        fontFamily: "sans-serif",
        text: flagEmojis.Japan,
        scale: entityFontIconScale,
      },
    },
  },
  Brazil: {
    label: "Brazil",
    glyph: {
      color: transparent,
      fontIcon: {
        fontFamily: "sans-serif",
        text: flagEmojis.Brazil,
        scale: entityFontIconScale,
      },
    },
  },
};

export const events = {
  event1: {
    entityIds: ["UK", "USA"],
    time: new Date(2025, 7, 14, 8, 49),
  },
  event2: {
    entityIds: ["UK", "Japan"],
    time: new Date(2025, 7, 14, 8, 56),
  },
  event3: {
    entityIds: ["UK", "Spain"],
    time: new Date(2025, 7, 14, 9, 2),
  },
  event4: {
    entityIds: ["UK", "Spain"],
    time: new Date(2025, 7, 14, 9, 27),
  },
  event5: {
    entityIds: ["Japan", "USA"],
    time: new Date(2025, 7, 14, 10, 20),
  },
  event6: {
    entityIds: ["USA", "UK"],
    time: new Date(2025, 7, 14, 10, 30),
  },
  event7: {
    entityIds: ["UK", "Spain"],
    time: new Date(2025, 7, 14, 10, 34),
  },
  event8: {
    entityIds: ["Brazil", "Japan"],
    time: new Date(2025, 7, 14, 11, 40),
  },
  event9: {
    entityIds: ["UK", "Spain"],
    time: new Date(2025, 7, 14, 10, 51),
  },
  event10: {
    entityIds: ["Spain", "UK"],
    time: new Date(2025, 7, 14, 12, 5),
  },
  event11: {
    entityIds: ["UK", "Spain"],
    time: new Date(2025, 7, 14, 14, 37),
  },
  event12: {
    entityIds: ["Japan", "Spain"],
    time: new Date(2025, 7, 14, 16, 7),
  },
  event13: {
    entityIds: ["Spain", "USA"],
    time: new Date(2025, 7, 14, 17, 42),
  },
  event14: {
    entityIds: ["UK", "Brazil"],
    time: new Date(2025, 7, 14, 13, 17),
  },
  event15: {
    entityIds: ["Brazil", "Spain"],
    time: new Date(2025, 7, 14, 15, 7),
  },
  event16: {
    entityIds: ["Brazil", "USA"],
    time: new Date(2025, 7, 14, 17, 8),
  },
};
<!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 { entities, events } from "./data";

export const Demo = () => <Timeline entities={entities} events={events} />;

const root = createRoot(document.getElementById("my-timeline"));
root.render(<Demo />);
const transparent = "rgba(0, 0, 0, 0)";
const entityFontIconScale = 2;

const flagEmojis = {
  UK: "πŸ‡¬πŸ‡§",
  USA: "πŸ‡ΊπŸ‡Έ",
  Spain: "πŸ‡ͺπŸ‡Έ",
  Japan: "πŸ‡―πŸ‡΅",
  Brazil: "πŸ‡§πŸ‡·",
};

export const entities = {
  UK: {
    label: "United Kingdom",
    color: "#15cad5",
    glyph: {
      color: transparent,
      fontIcon: {
        fontFamily: "sans-serif",
        text: flagEmojis.UK,
        scale: entityFontIconScale,
      },
    },
  },
  USA: {
    label: "United States",
    color: "#e12d39",
    glyph: {
      color: transparent,
      fontIcon: {
        fontFamily: "sans-serif",
        text: flagEmojis.USA,
        scale: entityFontIconScale,
      },
    },
  },
  Spain: {
    label: "Spain",
    color: "#f7d06e",
    glyph: {
      color: transparent,
      fontIcon: {
        fontFamily: "sans-serif",
        text: flagEmojis.Spain,
        scale: entityFontIconScale,
      },
    },
  },
  Japan: {
    label: "Japan",
    color: "#f9f9f9",
    glyph: {
      color: transparent,
      fontIcon: {
        fontFamily: "sans-serif",
        text: flagEmojis.Japan,
        scale: entityFontIconScale,
      },
    },
  },
  Brazil: {
    label: "Brazil",
    glyph: {
      color: transparent,
      fontIcon: {
        fontFamily: "sans-serif",
        text: flagEmojis.Brazil,
        scale: entityFontIconScale,
      },
    },
  },
};

export const events = {
  event1: {
    entityIds: ["UK", "USA"],
    time: new Date(2025, 7, 14, 8, 49),
  },
  event2: {
    entityIds: ["UK", "Japan"],
    time: new Date(2025, 7, 14, 8, 56),
  },
  event3: {
    entityIds: ["UK", "Spain"],
    time: new Date(2025, 7, 14, 9, 2),
  },
  event4: {
    entityIds: ["UK", "Spain"],
    time: new Date(2025, 7, 14, 9, 27),
  },
  event5: {
    entityIds: ["Japan", "USA"],
    time: new Date(2025, 7, 14, 10, 20),
  },
  event6: {
    entityIds: ["USA", "UK"],
    time: new Date(2025, 7, 14, 10, 30),
  },
  event7: {
    entityIds: ["UK", "Spain"],
    time: new Date(2025, 7, 14, 10, 34),
  },
  event8: {
    entityIds: ["Brazil", "Japan"],
    time: new Date(2025, 7, 14, 11, 40),
  },
  event9: {
    entityIds: ["UK", "Spain"],
    time: new Date(2025, 7, 14, 10, 51),
  },
  event10: {
    entityIds: ["Spain", "UK"],
    time: new Date(2025, 7, 14, 12, 5),
  },
  event11: {
    entityIds: ["UK", "Spain"],
    time: new Date(2025, 7, 14, 14, 37),
  },
  event12: {
    entityIds: ["Japan", "Spain"],
    time: new Date(2025, 7, 14, 16, 7),
  },
  event13: {
    entityIds: ["Spain", "USA"],
    time: new Date(2025, 7, 14, 17, 42),
  },
  event14: {
    entityIds: ["UK", "Brazil"],
    time: new Date(2025, 7, 14, 13, 17),
  },
  event15: {
    entityIds: ["Brazil", "Spain"],
    time: new Date(2025, 7, 14, 15, 7),
  },
  event16: {
    entityIds: ["Brazil", "USA"],
    time: new Date(2025, 7, 14, 17, 8),
  },
};
<!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>

Terms of use

These terms do not alter or supersede any existing agreements between you (or your employer) and us.

By accessing or using any Content you agree to be bound by these Terms of Use. Please review these terms carefully before using the website.

The contents of this website, including but not limited to any text, code samples, API references, schemas, interactive tools, and other materials (collectively, the 'Content'), are made available for informational and internal evaluation purposes only. All intellectual property rights in the Content are reserved. No licence is granted to use the Content for any commercial purpose, or to copy, distribute, modify, reverse-engineer, or incorporate any part of the Content into any product or service, without our prior written consent.

This Content is provided β€œas is” and β€œas available,” without any representations, warranties, or guarantees of any kind, whether express or implied, including but not limited to implied warranties of merchantability, fitness for a particular purpose, non-infringement, or accuracy. To the fullest extent permitted by applicable law, we expressly exclude and disclaim all implied warranties, conditions, and other terms that might otherwise be implied.

We disclaim all liability for any loss or damage, whether direct, indirect, incidental, consequential, or otherwise, arising from any reliance placed on the Content or from your use of it, to the fullest extent permitted by applicable law. By continuing to access or use the Content, you acknowledge and agree to these terms.