Data modeling
Getting setup

Getting Set Up for Data Modeling

You can define your data models in individual files using YAML or JavaScript. Generally, YAML is recommended for its simplicity and readability. (See Cube’s documentation (opens in a new tab) if you prefer JavaScript-based models.)

Embeddable supports two options for storing your models:

  1. In the same repository as your charting components.
  2. In a separate repository on its own.

1. Storing Models with Your Components

If you prefer an all-in-one approach, you can keep both your models and charting components in a single repository. This is ideal if a single team manages everything or you want an easy, consolidated project structure.

For a reference setup, take a look at our starter repo. It demonstrates a typical way to organize your files.

This is the default and requires no extra set up.

2. Storing Models Separately

If the team who will be creating the data models is a separate team to the team maintaining the javascript components, then it can be beneficial to store your models and components in separate code repositories. By separating them:

  • You can version and push each set of files independently.
  • You can work on model updates without interfering with UI components, and vice versa.

You can see an example of a dedicated models repo here (opens in a new tab).

Importantly, you'll need to update embeddable.config.ts to include:

pushModels: true,
pushComponents: false
  • This ensures that, when you push your models to your Embeddable workspace, only relevant model files are sent.

  • Importantly, this also includes any security context presets you've created to test row-level security.