diff --git a/lerna.json b/lerna.json
index 8b2066df4e..c13586be88 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,5 +1,5 @@
{
- "version": "0.1.13",
+ "version": "0.1.15",
"npmClient": "yarn",
"packages": [
"packages/*"
diff --git a/packages/builder/.gitignore b/packages/builder/.gitignore
index 49444a4fc0..69f2f5a00e 100644
--- a/packages/builder/.gitignore
+++ b/packages/builder/.gitignore
@@ -2,7 +2,6 @@
/node_modules/
node_modules_win
package-lock.json
-yarn.lock
release/
dist/
cypress/screenshots
diff --git a/packages/builder/package.json b/packages/builder/package.json
index ca1a6082e9..1775fc63d8 100644
--- a/packages/builder/package.json
+++ b/packages/builder/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
- "version": "0.1.13",
+ "version": "0.1.15",
"license": "AGPL-3.0",
"private": true,
"scripts": {
@@ -63,7 +63,9 @@
"@nx-js/compiler-util": "^2.0.0",
"@sentry/browser": "5.19.1",
"@svelteschool/svelte-forms": "^0.7.0",
+ "britecharts": "^2.16.0",
"codemirror": "^5.51.0",
+ "d3-selection": "^1.4.1",
"date-fns": "^1.29.0",
"deepmerge": "^4.2.2",
"fast-sort": "^2.2.0",
@@ -72,9 +74,9 @@
"lodash": "^4.17.13",
"lunr": "^2.3.5",
"mustache": "^4.0.1",
- "posthog-js": "^1.3.1",
+ "posthog-js": "1.3.1",
"safe-buffer": "^5.1.2",
- "shortid": "^2.2.8",
+ "shortid": "^2.2.15",
"string_decoder": "^1.2.0",
"svelte-portal": "^0.1.0",
"svelte-simple-modal": "^0.4.2",
diff --git a/packages/builder/src/builderStore/store/index.js b/packages/builder/src/builderStore/store/index.js
index c6ab194379..5b78ea0979 100644
--- a/packages/builder/src/builderStore/store/index.js
+++ b/packages/builder/src/builderStore/store/index.js
@@ -255,7 +255,7 @@ const setCurrentPage = store => pageName => {
* @param {string} componentToAdd - name of the component to add to the application
* @param {string} presetName - name of the component preset if defined
*/
-const addChildComponent = store => (componentToAdd, presetName) => {
+const addChildComponent = store => (componentToAdd, presetProps = {}) => {
store.update(state => {
function findSlot(component_array) {
for (let i = 0; i < component_array.length; i += 1) {
@@ -278,8 +278,6 @@ const addChildComponent = store => (componentToAdd, presetName) => {
const component = getComponentDefinition(state, componentToAdd)
- const presetProps = presetName ? component.presets[presetName] : {}
-
const instanceId = get(backendUiStore).selectedDatabase._id
const instanceName = get_capitalised_name(componentToAdd)
diff --git a/packages/builder/src/components/common/Checkbox.svelte b/packages/builder/src/components/common/Checkbox.svelte
index fe3f5756eb..3c5888d7c8 100644
--- a/packages/builder/src/components/common/Checkbox.svelte
+++ b/packages/builder/src/components/common/Checkbox.svelte
@@ -12,22 +12,24 @@
-
+
diff --git a/packages/standard-components/src/Chart/Brush.svelte b/packages/standard-components/src/Chart/Brush.svelte
new file mode 100644
index 0000000000..4294782575
--- /dev/null
+++ b/packages/standard-components/src/Chart/Brush.svelte
@@ -0,0 +1,118 @@
+
+
+
diff --git a/packages/standard-components/src/Chart/Bullet.svelte b/packages/standard-components/src/Chart/Bullet.svelte
new file mode 100644
index 0000000000..c4c140356e
--- /dev/null
+++ b/packages/standard-components/src/Chart/Bullet.svelte
@@ -0,0 +1,103 @@
+
+
+
diff --git a/packages/standard-components/src/Chart/Chart.svelte b/packages/standard-components/src/Chart/Chart.svelte
new file mode 100644
index 0000000000..3f1634719a
--- /dev/null
+++ b/packages/standard-components/src/Chart/Chart.svelte
@@ -0,0 +1,169 @@
+
+
+
+
+
+{#if useLegend}
+
+{/if}
diff --git a/packages/standard-components/src/Chart/Donut.svelte b/packages/standard-components/src/Chart/Donut.svelte
new file mode 100644
index 0000000000..08cdba7d2e
--- /dev/null
+++ b/packages/standard-components/src/Chart/Donut.svelte
@@ -0,0 +1,224 @@
+
+
+
+
+ {#if data.length > 0}
+
+ {/if}
+
diff --git a/packages/standard-components/src/Chart/GroupedBar.svelte b/packages/standard-components/src/Chart/GroupedBar.svelte
new file mode 100644
index 0000000000..70b111ed8c
--- /dev/null
+++ b/packages/standard-components/src/Chart/GroupedBar.svelte
@@ -0,0 +1,163 @@
+
+
+
+{#if useLegend}
+
+{/if}
diff --git a/packages/standard-components/src/Chart/Heatmap.svelte b/packages/standard-components/src/Chart/Heatmap.svelte
new file mode 100644
index 0000000000..2d5422d364
--- /dev/null
+++ b/packages/standard-components/src/Chart/Heatmap.svelte
@@ -0,0 +1,83 @@
+
+
+
+{#if useLegend}
+
+{/if}
diff --git a/packages/standard-components/src/Chart/Legend.svelte b/packages/standard-components/src/Chart/Legend.svelte
new file mode 100644
index 0000000000..f42e714507
--- /dev/null
+++ b/packages/standard-components/src/Chart/Legend.svelte
@@ -0,0 +1,82 @@
+
+
+{#if useLegend}
+
+{/if}
diff --git a/packages/standard-components/src/Chart/Line.svelte b/packages/standard-components/src/Chart/Line.svelte
new file mode 100644
index 0000000000..afb37322f3
--- /dev/null
+++ b/packages/standard-components/src/Chart/Line.svelte
@@ -0,0 +1,209 @@
+
+
+
+{#if useLegend}
+
+{/if}
+
+
diff --git a/packages/standard-components/src/Chart/ScatterPlot.svelte b/packages/standard-components/src/Chart/ScatterPlot.svelte
new file mode 100644
index 0000000000..d685f7421f
--- /dev/null
+++ b/packages/standard-components/src/Chart/ScatterPlot.svelte
@@ -0,0 +1,187 @@
+
+
+
+{#if useLegend}
+
+{/if}
diff --git a/packages/standard-components/src/Chart/Sparkline.svelte b/packages/standard-components/src/Chart/Sparkline.svelte
new file mode 100644
index 0000000000..e1bc29e278
--- /dev/null
+++ b/packages/standard-components/src/Chart/Sparkline.svelte
@@ -0,0 +1,103 @@
+
+
+
+{#if useLegend}
+
+{/if}
diff --git a/packages/standard-components/src/Chart/StackedArea.svelte b/packages/standard-components/src/Chart/StackedArea.svelte
new file mode 100644
index 0000000000..0218ae327f
--- /dev/null
+++ b/packages/standard-components/src/Chart/StackedArea.svelte
@@ -0,0 +1,181 @@
+
+
+
+{#if useLegend}
+
+{/if}
diff --git a/packages/standard-components/src/Chart/StackedBar.svelte b/packages/standard-components/src/Chart/StackedBar.svelte
new file mode 100644
index 0000000000..f616d1a398
--- /dev/null
+++ b/packages/standard-components/src/Chart/StackedBar.svelte
@@ -0,0 +1,176 @@
+
+
+
+{#if useLegend}
+
+{/if}
diff --git a/packages/standard-components/src/Chart/Step.svelte b/packages/standard-components/src/Chart/Step.svelte
new file mode 100644
index 0000000000..342f5ca3ec
--- /dev/null
+++ b/packages/standard-components/src/Chart/Step.svelte
@@ -0,0 +1,129 @@
+
+
+
+{#if useLegend}
+
+{/if}
diff --git a/packages/standard-components/src/Chart/Temp.svelte b/packages/standard-components/src/Chart/Temp.svelte
new file mode 100644
index 0000000000..1703c7b604
--- /dev/null
+++ b/packages/standard-components/src/Chart/Temp.svelte
@@ -0,0 +1,41 @@
+
+
+
+{#if useLegend}
+
+{/if}
diff --git a/packages/standard-components/src/Chart/index.js b/packages/standard-components/src/Chart/index.js
new file mode 100644
index 0000000000..39efc5d8ea
--- /dev/null
+++ b/packages/standard-components/src/Chart/index.js
@@ -0,0 +1,12 @@
+export { default as donut } from "./Donut.svelte"
+export { default as bar } from "./Bar.svelte"
+export { default as line } from "./Line.svelte"
+export { default as brush } from "./Brush.svelte"
+export { default as bullet } from "./Bullet.svelte"
+export { default as groupedbar } from "./GroupedBar.svelte"
+export { default as heatmap } from "./Heatmap.svelte"
+export { default as sparkline } from "./Sparkline.svelte"
+export { default as scatterplot } from "./ScatterPlot.svelte"
+export { default as step } from "./Step.svelte"
+export { default as stackedarea } from "./StackedArea.svelte"
+export { default as stackedbar } from "./StackedBar.svelte"
diff --git a/packages/standard-components/src/Chart/tests/bar.html b/packages/standard-components/src/Chart/tests/bar.html
new file mode 100644
index 0000000000..4bedca035a
--- /dev/null
+++ b/packages/standard-components/src/Chart/tests/bar.html
@@ -0,0 +1,73 @@
+
+
+
+
+
+ Document
+
+
+
+
+
+
+
+
+
+
+ Bar Chart
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/standard-components/src/Chart/utils.js b/packages/standard-components/src/Chart/utils.js
new file mode 100644
index 0000000000..382c95ff36
--- /dev/null
+++ b/packages/standard-components/src/Chart/utils.js
@@ -0,0 +1,19 @@
+import britecharts from "britecharts"
+
+export const notNull = value => value || value === false
+
+export const chartTypes = britecharts ? Object.keys(britecharts) : null
+
+//expose chart color schemas for use or reference outside compnent
+export const colorSchemas = britecharts ? britecharts.colors.colorSchemas : null
+
+//export color gradients for use or reference outside the component
+export const colorGradients = britecharts
+ ? britecharts.colors.colorGradients
+ : null
+
+export const getColorSchema = color =>
+ color ? colorSchemas[color] : colorSchemas["britecharts"]
+
+export const getChartGradient = gradient =>
+ gradient ? colorGradients[gradient] : null
diff --git a/packages/standard-components/src/DataChart.svelte b/packages/standard-components/src/DataChart.svelte
index bccfc6314a..8b6dcdcc17 100644
--- a/packages/standard-components/src/DataChart.svelte
+++ b/packages/standard-components/src/DataChart.svelte
@@ -23,6 +23,8 @@
},
}
+ $: console.log("CHART CONFIGS", chartConfigs)
+
async function fetchData() {
const FETCH_RECORDS_URL = `/api/views/all_${model}`
const response = await _bb.api.get(FETCH_RECORDS_URL)
diff --git a/packages/standard-components/src/index.js b/packages/standard-components/src/index.js
index 8cc6defe98..071ffa1bcf 100644
--- a/packages/standard-components/src/index.js
+++ b/packages/standard-components/src/index.js
@@ -24,3 +24,4 @@ export { default as datasearch } from "./DataSearch.svelte"
export { default as embed } from "./Embed.svelte"
export { default as stackedlist } from "./StackedList.svelte"
export { default as recorddetail } from "./RecordDetail.svelte"
+export * from "./Chart"