@graphenedata/cli 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/LICENSE.md +100 -0
  2. package/THIRD_PARTY_NOTICES.md +12 -0
  3. package/cli.ts +157 -0
  4. package/dist/cli/cli.js +43 -0
  5. package/dist/docs/data_apps/components/charts/annotations.md +673 -0
  6. package/dist/docs/data_apps/components/charts/area-chart.md +202 -0
  7. package/dist/docs/data_apps/components/charts/bar-chart.md +317 -0
  8. package/dist/docs/data_apps/components/charts/box-plot.md +190 -0
  9. package/dist/docs/data_apps/components/charts/bubble-chart.md +151 -0
  10. package/dist/docs/data_apps/components/charts/calendar-heatmap.md +112 -0
  11. package/dist/docs/data_apps/components/charts/custom-echarts.md +308 -0
  12. package/dist/docs/data_apps/components/charts/echarts-options.md +217 -0
  13. package/dist/docs/data_apps/components/charts/funnel-chart.md +106 -0
  14. package/dist/docs/data_apps/components/charts/heatmap.md +180 -0
  15. package/dist/docs/data_apps/components/charts/histogram.md +107 -0
  16. package/dist/docs/data_apps/components/charts/line-chart.md +265 -0
  17. package/dist/docs/data_apps/components/charts/mixed-type-charts.md +240 -0
  18. package/dist/docs/data_apps/components/charts/sankey-diagram.md +301 -0
  19. package/dist/docs/data_apps/components/charts/scatter-plot.md +134 -0
  20. package/dist/docs/data_apps/components/charts/sparkline.md +68 -0
  21. package/dist/docs/data_apps/components/data/big-value.md +153 -0
  22. package/dist/docs/data_apps/components/data/delta.md +89 -0
  23. package/dist/docs/data_apps/components/data/table.md +470 -0
  24. package/dist/docs/data_apps/components/data/value.md +97 -0
  25. package/dist/docs/data_apps/components/inputs/button-group.md +154 -0
  26. package/dist/docs/data_apps/components/inputs/checkbox.md +52 -0
  27. package/dist/docs/data_apps/components/inputs/date-input.md +131 -0
  28. package/dist/docs/data_apps/components/inputs/date-range.md +124 -0
  29. package/dist/docs/data_apps/components/inputs/dimension-grid.md +67 -0
  30. package/dist/docs/data_apps/components/inputs/dropdown.md +199 -0
  31. package/dist/docs/data_apps/components/inputs/index.md +3 -0
  32. package/dist/docs/data_apps/components/inputs/slider.md +126 -0
  33. package/dist/docs/data_apps/components/inputs/text-input.md +86 -0
  34. package/dist/docs/data_apps/components/maps/area-map.md +397 -0
  35. package/dist/docs/data_apps/components/maps/base-map.md +269 -0
  36. package/dist/docs/data_apps/components/maps/bubble-map.md +361 -0
  37. package/dist/docs/data_apps/components/maps/point-map.md +326 -0
  38. package/dist/docs/data_apps/components/maps/us-map.md +167 -0
  39. package/dist/docs/data_apps/components/ui/accordion.md +116 -0
  40. package/dist/docs/data_apps/components/ui/alert.md +37 -0
  41. package/dist/docs/data_apps/components/ui/big-link.md +19 -0
  42. package/dist/docs/data_apps/components/ui/details.md +58 -0
  43. package/dist/docs/data_apps/components/ui/download-data.md +41 -0
  44. package/dist/docs/data_apps/components/ui/embed.md +47 -0
  45. package/dist/docs/data_apps/components/ui/grid.md +45 -0
  46. package/dist/docs/data_apps/components/ui/image.md +61 -0
  47. package/dist/docs/data_apps/components/ui/info.md +47 -0
  48. package/dist/docs/data_apps/components/ui/last-refreshed.md +28 -0
  49. package/dist/docs/data_apps/components/ui/link-button.md +20 -0
  50. package/dist/docs/data_apps/components/ui/link.md +40 -0
  51. package/dist/docs/data_apps/components/ui/modal.md +57 -0
  52. package/dist/docs/data_apps/components/ui/note.md +32 -0
  53. package/dist/docs/data_apps/components/ui/print-format-components.md +85 -0
  54. package/dist/docs/data_apps/components/ui/tabs.md +122 -0
  55. package/dist/docs/graphene.md +129 -0
  56. package/dist/ui/app.css +332 -0
  57. package/dist/ui/assets/favicon.ico +0 -0
  58. package/dist/ui/component-utilities/autoFormatting.js +301 -0
  59. package/dist/ui/component-utilities/builtInFormats.js +482 -0
  60. package/dist/ui/component-utilities/chartContext.js +12 -0
  61. package/dist/ui/component-utilities/chartWindowDebug.js +21 -0
  62. package/dist/ui/component-utilities/checkInputs.js +95 -0
  63. package/dist/ui/component-utilities/convert.js +15 -0
  64. package/dist/ui/component-utilities/dateParsing.js +57 -0
  65. package/dist/ui/component-utilities/dropdownContext.ts +1 -0
  66. package/dist/ui/component-utilities/echarts.js +262 -0
  67. package/dist/ui/component-utilities/echartsThemes.js +453 -0
  68. package/dist/ui/component-utilities/formatTitle.js +24 -0
  69. package/dist/ui/component-utilities/formatting.js +258 -0
  70. package/dist/ui/component-utilities/getColumnExtents.js +79 -0
  71. package/dist/ui/component-utilities/getColumnSummary.js +67 -0
  72. package/dist/ui/component-utilities/getCompletedData.js +114 -0
  73. package/dist/ui/component-utilities/getDistinctCount.js +7 -0
  74. package/dist/ui/component-utilities/getDistinctValues.js +15 -0
  75. package/dist/ui/component-utilities/getSeriesConfig.js +236 -0
  76. package/dist/ui/component-utilities/getSortedData.js +7 -0
  77. package/dist/ui/component-utilities/getStackPercentages.js +43 -0
  78. package/dist/ui/component-utilities/getStackedData.js +17 -0
  79. package/dist/ui/component-utilities/getYAxisIndex.js +15 -0
  80. package/dist/ui/component-utilities/globalContexts.js +1 -0
  81. package/dist/ui/component-utilities/helpers/getCompletedData.helpers.js +119 -0
  82. package/dist/ui/component-utilities/inputUtils.ts +25 -0
  83. package/dist/ui/component-utilities/replaceNulls.js +14 -0
  84. package/dist/ui/component-utilities/tableUtils.ts +120 -0
  85. package/dist/ui/component-utilities/themeStores.ts +116 -0
  86. package/dist/ui/components/Area.svelte +174 -0
  87. package/dist/ui/components/AreaChart.svelte +150 -0
  88. package/dist/ui/components/Bar.svelte +326 -0
  89. package/dist/ui/components/BarChart.svelte +194 -0
  90. package/dist/ui/components/BigValue.svelte +69 -0
  91. package/dist/ui/components/Chart.svelte +1070 -0
  92. package/dist/ui/components/Column.svelte +172 -0
  93. package/dist/ui/components/DateRange.svelte +324 -0
  94. package/dist/ui/components/Dropdown.svelte +738 -0
  95. package/dist/ui/components/DropdownOption.svelte +21 -0
  96. package/dist/ui/components/ECharts.svelte +77 -0
  97. package/dist/ui/components/ErrorChart.svelte +54 -0
  98. package/dist/ui/components/GrapheneQuery.svelte +12 -0
  99. package/dist/ui/components/InlineDelta.svelte +150 -0
  100. package/dist/ui/components/Line.svelte +210 -0
  101. package/dist/ui/components/LineChart.svelte +178 -0
  102. package/dist/ui/components/PieChart.svelte +36 -0
  103. package/dist/ui/components/QueryLoad.svelte +82 -0
  104. package/dist/ui/components/Row.svelte +14 -0
  105. package/dist/ui/components/SortIcon.svelte +32 -0
  106. package/dist/ui/components/Table.svelte +19 -0
  107. package/dist/ui/components/TableCell.svelte +75 -0
  108. package/dist/ui/components/TableGroupRow.svelte +136 -0
  109. package/dist/ui/components/TableGroupToggle.svelte +42 -0
  110. package/dist/ui/components/TableHeader.svelte +242 -0
  111. package/dist/ui/components/TableRow.svelte +283 -0
  112. package/dist/ui/components/TableSubtotalRow.svelte +62 -0
  113. package/dist/ui/components/TableTotalRow.svelte +88 -0
  114. package/dist/ui/components/TextInput.svelte +92 -0
  115. package/dist/ui/components/_Table.svelte +516 -0
  116. package/dist/ui/internal/clientCache.ts +43 -0
  117. package/dist/ui/internal/queryEngine.ts +169 -0
  118. package/dist/ui/internal/telemetry.ts +28 -0
  119. package/dist/ui/internal/theme.ts +88 -0
  120. package/dist/ui/layout.svelte +3 -0
  121. package/dist/ui/playwright.config.ts +30 -0
  122. package/dist/ui/web.js +106 -0
  123. package/package.json +71 -0
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: Link
3
+ description: Add an inline link into your markdown
4
+ ---
5
+
6
+ > **Note:** You can also use [markdown syntax for links](/reference/markdown#links). This component is useful when you need to customize the behavior or styling of the link (e.g., opening in new tab vs. current tab)
7
+
8
+ Use the `Link` component to add styled and accessible links to your markdown pages. This component allows you to control the destination URL, link text, and whether it opens in a new tab.
9
+
10
+ ## Default usage
11
+
12
+ **Example:**
13
+
14
+ ```markdown
15
+ <Link
16
+ url="https://github.com/evidence-dev/evidence"
17
+ label="Visit Example"
18
+ />
19
+ ```
20
+
21
+ ### Open in a new tab
22
+
23
+ **Example:**
24
+
25
+ ```markdown
26
+ <Link
27
+ url="https://github.com/evidence-dev/evidence"
28
+ label="Visit Example"
29
+ newTab=true
30
+ />
31
+ ```
32
+
33
+ ## Options
34
+
35
+ | Property | Description | Required | Options | Default |
36
+ |----------|-------------|----------|---------|---------|
37
+ | url | The destination URL of the link. It can accept either a full external link (e.g. `https://google.com`) or link to another page within your evidence app (e.g. `/sales/performance`). | true | string | - |
38
+ | label | The text displayed for the link. | false | string | Click here |
39
+ | newTab | Whether the link should open in a new tab | false | true, false | false |
40
+ | class | Pass custom classes to style the link. Supports [Tailwind classes](https://tailwindcss.com). | false | string | - |
@@ -0,0 +1,57 @@
1
+ ---
2
+ title: Modal
3
+ description: Display a pop-up dialog when a button is clicked.
4
+ ---
5
+
6
+ **Example:**
7
+
8
+ ```markdown
9
+ <Modal title="Title" buttonText='Open Modal'>
10
+
11
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
12
+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
13
+ Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
14
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
15
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
16
+
17
+ </Modal>
18
+ ```
19
+
20
+ ## Styling
21
+
22
+ Modals support markdown in the body, but you need to leave whitespace between the text and the modal tags.
23
+
24
+ **Example:**
25
+
26
+ ```markdown
27
+ <Modal title="Title" buttonText='Open Modal'>
28
+
29
+ **bold** and _italic_ text is supported.
30
+
31
+ </Modal>
32
+ ```
33
+
34
+ ## Including Components
35
+
36
+
37
+ You can include components inside a Modal, like charts or tables:
38
+
39
+ **Example:**
40
+
41
+ ```svelte
42
+ <Modal title='Chart Example' buttonText='Click to See Chart'>
43
+ <LineChart
44
+ data="orders_by_month"
45
+ x=order_month
46
+ y=sales_usd0k
47
+ />
48
+ </Modal>
49
+ ```
50
+
51
+ ## Options
52
+
53
+ | Property | Description | Required | Options | Default |
54
+ |----------|-------------|----------|---------|---------|
55
+ | buttonText | The text displayed on the button that triggers the modal. | true | string | - |
56
+ | title | The title of the modal. Visible at the top of the modal when it is open | false | string | - |
57
+ | open | A boolean value that determines whether the modal is closed by default. | false | true, false | false |
@@ -0,0 +1,32 @@
1
+ ---
2
+ title: Note
3
+ description: Display smaller text for definitions, notes, and footnotes
4
+ ---
5
+
6
+ Use the `Note` component to display small, styled text for additional context or information
7
+
8
+ ## Default usage
9
+
10
+ **Example:**
11
+
12
+ ```markdown
13
+ <Note>
14
+ This is a note for additional context.
15
+ </Note>
16
+ ```
17
+
18
+ ### Custom styling
19
+
20
+ **Example:**
21
+
22
+ ```markdown
23
+ <Note class="text-negative">
24
+ This is a custom-styled note.
25
+ </Note>
26
+ ```
27
+
28
+ ## Options
29
+
30
+ | Property | Description | Options |
31
+ |----------|-------------|---------|
32
+ | class | Pass custom classes to style the note. Supports [Tailwind classes](https://tailwindcss.com). | string |
@@ -0,0 +1,85 @@
1
+ ---
2
+ title: Print Format Components
3
+ description: Format your report content for PDF export or printing.
4
+ ---
5
+
6
+ These components can be used to format your report content for PDF export or printing.
7
+
8
+ ## LineBreak
9
+ Inserts a line break on the page (in the UI as well as on print).
10
+
11
+ This can be helpful when working with many input components (filters, dropdowns, etc.)
12
+
13
+ ```html
14
+ Text on original line <LineBreak/> Text on new line
15
+ ```
16
+
17
+ ### Options
18
+
19
+ | Name | Description | Required | Options | Default |
20
+ |------|-------------|----------|---------|---------|
21
+ | lines | Number of line breaks to insert | false | number | 1 |
22
+
23
+ ## PageBreak
24
+ On print, inserts a page break - pushing the next content onto the start of a new page.
25
+
26
+ ```html
27
+ The purple line chart in this section will print on a new page.
28
+
29
+ <LineChart
30
+ data="orders_by_month"
31
+ x=month
32
+ y=sales_usd0k
33
+ />
34
+
35
+ <PageBreak/>
36
+
37
+ <LineChart
38
+ data="orders_by_month"
39
+ x=month
40
+ y=sales_usd0k
41
+ lineColor=purple
42
+ />
43
+
44
+ ```
45
+
46
+ ## PrintGroup
47
+ - Combines content to be printed on the same page if possible
48
+ - Offers a `hidden` prop. If `true`, the content within the PrintGroup will not be printed
49
+
50
+ ```html
51
+ <PrintGroup>
52
+
53
+ The 2 heatmaps below will be printed on the same page if possible
54
+
55
+ <Heatmap data="item_channel" x=channel y=item value=orders/>
56
+ <Heatmap data="item_channel" x=channel y=item value=orders/>
57
+ </PrintGroup>
58
+ ```
59
+
60
+ ### `hidden=true`
61
+
62
+ ```html
63
+ The purple line chart will be hidden on print
64
+
65
+ <LineChart
66
+ data="orders_by_month"
67
+ x=month
68
+ y=sales_usd0k
69
+ />
70
+
71
+ <PrintGroup hidden=true>
72
+ <LineChart
73
+ data="orders_by_month"
74
+ x=month
75
+ y=sales_usd0k
76
+ lineColor=purple
77
+ />
78
+ </PrintGroup>
79
+ ```
80
+
81
+ ### Options
82
+
83
+ | Name | Description | Required | Options | Default |
84
+ |------|-------------|----------|---------|---------|
85
+ | hidden | If true, the content within the PrintGroup will not be printed | false | ['true', 'false'] | 'false' |
@@ -0,0 +1,122 @@
1
+ ---
2
+ title: Tabs
3
+ description: Organize content across multiple panes.
4
+ ---
5
+
6
+ Use Tabs to organize content across multiple panes.
7
+
8
+ **Example:**
9
+
10
+ ```markdown
11
+ <Tabs>
12
+ <Tab label="First Tab">
13
+ Content of the First Tab
14
+
15
+ You can use **markdown** here too!
16
+ </Tab>
17
+ <Tab label="Second Tab">
18
+ Content of the Second Tab
19
+
20
+ Here's a [link](https://www.google.com)
21
+ </Tab>
22
+ </Tabs>
23
+ ```
24
+
25
+ ## Examples
26
+
27
+ ### Full Width
28
+
29
+ **Example:**
30
+
31
+ ```markdown
32
+ <Tabs fullWidth=true>
33
+ <Tab label="First Tab">
34
+ Content of the First Tab
35
+ </Tab>
36
+ <Tab label="Second Tab">
37
+ Content of the Second Tab
38
+ </Tab>
39
+ </Tabs>
40
+ ```
41
+
42
+ ### Theme Color
43
+
44
+ **Example:**
45
+
46
+ ```markdown
47
+ <Tabs color=primary>
48
+ <Tab label="Primary Tabs">
49
+ Content of the First Tab
50
+ </Tab>
51
+ <Tab label="Second Tab">
52
+ Content of the Second Tab
53
+ </Tab>
54
+ </Tabs>
55
+ ```
56
+
57
+ ### Custom Color
58
+
59
+ **Example:**
60
+
61
+ ```markdown
62
+ <Tabs color=#ff0000>
63
+ <Tab label="Red Tabs">
64
+ Content of the First Tab
65
+ </Tab>
66
+ <Tab label="Second Tab">
67
+ Content of the Second Tab
68
+ </Tab>
69
+ </Tabs>
70
+ ```
71
+
72
+ ### Background Color
73
+
74
+ **Example:**
75
+
76
+ ```markdown
77
+ <Tabs background=true>
78
+ <Tab label="First Tab">
79
+ Content of the First Tab
80
+ </Tab>
81
+ <Tab label="Second Tab">
82
+ Content of the Second Tab
83
+ </Tab>
84
+ </Tabs>
85
+ ```
86
+
87
+ ### Persist Selected Tab to URL
88
+
89
+ **Example:**
90
+
91
+ ```markdown
92
+ <Tabs id="example-tab">
93
+ <Tab label="One">
94
+ Click Second id Tab and notice the the url updates!
95
+ </Tab>
96
+ <Tab label="Two">
97
+ Refresh the page and the tab you selected persists!
98
+ </Tab>
99
+ </Tabs>
100
+ ```
101
+
102
+ # Tabs
103
+
104
+ ## Options
105
+
106
+ | Property | Description | Options | Default |
107
+ |----------|-------------|---------|---------|
108
+ | id | Unique Id for this set of tabs. When set, the selected tab is included in the URL so it can be shared. | string | - |
109
+ | color | Color for the active tab. Accepts theme tokens | Any valid hex, rgb, or hsl string | base-content |
110
+ | fullWidth | Tabs take up full width of page | true, false | false |
111
+ | background | Include background color on active tab. Color is automatically determined based on `color` prop | true, false | false |
112
+
113
+ # Tab
114
+
115
+ ## Options
116
+
117
+ | Property | Description | Required | Options | Default |
118
+ |----------|-------------|----------|---------|---------|
119
+ | label | Label for the tab | true | string | - |
120
+ | id | Unique Id for this tab. Only needed if 2 tabs have the same label (not recommended). | false | string | - |
121
+ | printShowAll | On print/PDF, the Tabs will repeat to show all content by default. Turn this off to leave the component collapsed in print. | false | true, false | true |
122
+ | description | Adds an info icon with description tooltip on hover | false | string | - |
@@ -0,0 +1,129 @@
1
+ # How to develop in Graphene
2
+
3
+ Graphene is a framework for building semantic layers and data visualizations in code. Graphene projects are comprised of:
4
+ - .gsql files that define semantics-enriched tables (aka semantic models)
5
+ - .md files that define data apps (dashboards)
6
+
7
+ Graphene also has a CLI that lets you check syntax, run queries, serve data apps, and more.
8
+
9
+ ## Graphene SQL (GSQL)
10
+
11
+ ### Tables
12
+ Tables have to be declared first before they can be queried. A table in Graphene has the added concept of _semantics_. Semantics are stored expressions and join relationships associated with a table that `select` queries can leverage. This allows query logic to be centralized, reusable, and more easily governed.
13
+
14
+ Here's an example:
15
+
16
+ ```gsql
17
+ table orders (
18
+ id BIGINT primary_key,
19
+ user_id BIGINT,
20
+ created_at DATETIME,
21
+ amount FLOAT, -- paid by customer #units=usd
22
+ cost FLOAT, -- cost of materials #units=usd
23
+
24
+ join_one users on user_id = users.id,
25
+
26
+ sum(amount) as revenue,
27
+ sum(amount - cost) as profit,
28
+ profit / revenue as profit_margin
29
+ );
30
+
31
+ table users (
32
+ id BIGINT primary_key,
33
+ name VARCHAR,
34
+ email VARCHAR,
35
+ age INTEGER,
36
+
37
+ join_many orders on id = orders.user_id
38
+ );
39
+ ```
40
+
41
+ Syntax notes
42
+ - `table foo (...)` defines a Graphene table based on the database table `foo`.
43
+ - The allowed join types are `join_one` and `join_many`. All joins are left outer joins. There is no inner, right, or cross join.
44
+ - `join_one` is used if there are many rows in the **left** table for each row in the **right** table.
45
+ - `join_many` is used if there are many rows in the **right** table for each row in the **left** table.
46
+ - Join names within a table must be unique. Polymorphic relationships (eg., where there are multiple relationships between the same two tables on different keys) are allowed but must be aliased eg. `join_one users as owner on user_id = owner.id` and `join_one users as viewer on user_id = viewer.id`.
47
+ - Comments in tables can provide descriptions as well as metadata (denoted by `#` inside the comment).
48
+
49
+ Best practices
50
+ - For a given table, only model joins that are directly on that table. Graphene will automatically traverse multi-hop joins when it compiles the collective table space.
51
+ - A join between two tables should be modeled in both the respective `table` statements. This may seem redundant but it offers more flexibility for queries to choose which table to set in the `from` (remember that direction matters since all joins are left joins).
52
+
53
+ ### Queries
54
+ Graphene tables can be queried using `select` statements. Here are some example queries on the tables above:
55
+
56
+ ```
57
+ -- top 10 customers by profit
58
+ from orders select
59
+ users.name, -- notice how we can access the joined table without a join here
60
+ profit -- this expands into the stored expression defined in the table
61
+ order by 2 desc
62
+ limit 10
63
+ ```
64
+
65
+ ```
66
+ -- average age of customers over time
67
+ select
68
+ month(date),
69
+ average(users.age), -- in normal SQL this would fan-out in the join; in Graphene it smartly de-duplicates the fan-out when computing aggregates
70
+ from orders
71
+ ```
72
+
73
+ Syntax notes
74
+ - Columns and stored expressions from joined tables can be accessed with the dot operator, eg. `users.age` in the example above. Multiple join hops can be traversed with multiple dots, eg. `users.countries.country_code`.
75
+ - `join_one` and `join_many` work here, too. This is useful if the join you need has not been modeled already.
76
+ - The `from`, `select`, `group by`, and `where` clauses can be written in any order.
77
+ - Expressions in `group by` are implicitly selected, so `from orders select avg(amount) group by user_id` is valid.
78
+ - `group by all` is implied if aggregate and scalar expressions are both present in the `select`. It can be omitted and the query will still effectively execute the `group by all`.
79
+ - `count` is a reserved word. Do not alias your columns as `count`.
80
+
81
+
82
+ ## Graphene viz (.md)
83
+ Graphene data apps are written in Markdown with components. Markdown files can contain named GSQL queries in code fences that components can then refer to. Those queries can use any tables defined in .gsql files.
84
+
85
+ ````markdown
86
+ # Order analysis
87
+ Looking at our order breakdowns.
88
+
89
+ ```sql orders_by_month
90
+ from orders select date_trunc(created_at, month) as month, count(*) as num_orders, profit
91
+ ```
92
+
93
+ <Row>
94
+ <LineChart data="orders_by_month" x="month" y="num_orders" title="Orders by Month" />
95
+ <LineChart data="orders" x="date_trunc(created_at, month)" y="profit" title="Profit by Month, USD" />
96
+ </Row>
97
+ ````
98
+
99
+ Note that components can also directly refer to Graphene tables in their `data` property; it is not always necessary to prepare data in a code-fenced query. Properties that take column references can also take whole expressions, as shown in the second line chart from the example above.
100
+
101
+ ### Components
102
+ The following components are available:
103
+ - [BarChart](./data_apps/components/charts/bar-chart.md)
104
+ - [LineChart](./data_apps/components/charts/line-chart.md)
105
+ - [AreaChart](./data_apps/components/charts/area-chart.md)
106
+ - PieChart - takes a `category` and `value` attribute
107
+ - Row - evenly distributes its children in a row
108
+ - [DateRange](./data_apps/components/inputs/date-range.md)
109
+ - [BigValue](./data_apps/components/data/big-value.md)
110
+ - [Table](./data_apps/components/data/table.md)
111
+ - [TextInput](./data_apps/components/inputs/text-input.md)
112
+
113
+ ## Using the Graphene CLI
114
+ These are the available commands:
115
+ - `npm run cli check` - Checks the syntax for the entire Graphene project.
116
+ - `npm run cli compile "<GSQL>"` - Shows how GSQL is translated into the underlying database SQL.
117
+ - `npm run cli run "<GSQL>"` - Runs a GSQL query. The tables and semantics defined in all .gsql files in the project are available for the query to use.
118
+ - `npm run cli serve` - Starts (or restarts) the dev server, which allows the user to view their Graphene app on localhost.
119
+ - `npm run cli view <mdPath>` - Captures a screenshot of a given .md file, along with any errors encountered.
120
+
121
+ ## AGENT INSTRUCTIONS
122
+ Follow these guidelines when working in a Graphene project.
123
+ - Before writing any GSQL queries, run them in the CLI first to make sure that the results make sense.
124
+ - Do not redefine joins or expressions in a GSQL query that already exist in a semantic model. For example, if profit has already been defined as the stored expression `sum(revenue - cost) as profit` on the table `orders`, you can simply use it in a downstream query as `select profit from orders`.
125
+ - Because all joins in Graphene are left outer joins, be mindful about your `from` table selection.
126
+ - When adding a component to a .md file, read the associated documentation page first in /docs/data_apps/components so you understand all the available configurations.
127
+ - Do not try to search the web for Graphene-specific info; you will not find anything. All the documentation is in /docs.
128
+ - If you write to a .gsql file, run a syntax check with `npm run cli check`.
129
+ - If you write to a .md file, run a syntax check with `npm run cli check`. Once there are no syntax errors, do a visual check by running `npm run cli view <mdPath>` and looking at the .png it generates.