Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apex charts #817

Merged
merged 33 commits into from
Nov 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
242cd77
Set top level background colour
aptkingston Nov 2, 2020
0e89f6e
Merge branch 'master' of github.com:Budibase/budibase into apex-charts
aptkingston Nov 2, 2020
ab78620
Add bar chart with initial apex charts config
aptkingston Nov 2, 2020
75bfa60
Fix evil falsiness bug with frontend property settings checkboxes
aptkingston Nov 3, 2020
465f2a6
Add multi option select and multi table view field select components
aptkingston Nov 3, 2020
4873c66
Tidy up option select
aptkingston Nov 3, 2020
0ea3058
Add line chart and enable multiple data series for all charts
aptkingston Nov 3, 2020
ae876c6
Add stacked option to bar chart
aptkingston Nov 3, 2020
0aa672f
Remove log statement
aptkingston Nov 3, 2020
4f20795
Remove log statement
aptkingston Nov 3, 2020
bcc86af
Fix multi option select handling of default value being hardcoded to …
aptkingston Nov 3, 2020
ff15205
Fix another evil falsiness bug with setting checkboxes
aptkingston Nov 3, 2020
3e06d39
Default bar chart data labels to false
aptkingston Nov 3, 2020
3d84b83
Add pie and donut charts
aptkingston Nov 3, 2020
91ef7fd
Add area chart and unit formatting
aptkingston Nov 3, 2020
c98e59d
Fix legends not being centered and use common chart component
aptkingston Nov 3, 2020
7130d07
Merge branch 'master' of github.com:Budibase/budibase into apex-charts
aptkingston Nov 4, 2020
6cddc36
Fix beta warning overlap
aptkingston Nov 4, 2020
0c48a20
Add support for dates and increase robustness
aptkingston Nov 4, 2020
9055744
Improve robustness of pie and donut charts
aptkingston Nov 4, 2020
e1b3982
Fix crash when saving rows
aptkingston Nov 4, 2020
c7ef9fa
Improve chart robustness even more
aptkingston Nov 4, 2020
d985382
Remove unecessary lodash import
aptkingston Nov 4, 2020
3fec924
Remove unused chart settings
aptkingston Nov 4, 2020
8742c93
Remove additional unused chart settings
aptkingston Nov 4, 2020
3457b30
Add candlestick chart
aptkingston Nov 4, 2020
09302d4
Separate chart loading state from error state
aptkingston Nov 4, 2020
ff16e90
Fix warning when no data source and increase robustness of charts
aptkingston Nov 4, 2020
209f717
Fix lint
aptkingston Nov 4, 2020
7bb3607
Reduce padding and indentation in nav items to provide more room for …
aptkingston Nov 5, 2020
4754f7e
Fix style of DND navigation
aptkingston Nov 5, 2020
732685e
Ensure candlestick chart works with either our own date formats as we…
aptkingston Nov 5, 2020
31c083d
Add colour palette options for charts
aptkingston Nov 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/builder/src/components/common/NavItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class="nav-item"
class:border
class:selected
style={`padding-left: ${indentLevel * 18}px`}
style={`padding-left: ${indentLevel * 14}px`}
{draggable}
on:dragend
on:dragstart
Expand Down Expand Up @@ -65,7 +65,7 @@
}

.content {
padding: 0 var(--spacing-m);
padding: 0 var(--spacing-s);
height: 32px;
display: flex;
flex-direction: row;
Expand Down Expand Up @@ -97,6 +97,9 @@
flex: 1 1 auto;
font-weight: 500;
font-size: var(--font-size-xs);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.actions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
ondragover="return false"
ondragenter="return false"
class="drop-item"
style="margin-left: {(level + 1) * 18}px" />
style="margin-left: {(level + 1) * 16}px" />
{/if}

<NavItem
Expand Down Expand Up @@ -160,7 +160,7 @@
ondragover="return false"
ondragenter="return false"
class="drop-item"
style="margin-left: {(level + ($dragDropStore.dropPosition === 'inside' ? 3 : 1)) * 18}px" />
style="margin-left: {(level + ($dragDropStore.dropPosition === 'inside' ? 3 : 1)) * 16}px" />
{/if}
</li>
{/each}
Expand All @@ -176,6 +176,6 @@
.drop-item {
border-radius: var(--border-radius-m);
height: 32px;
background: var(--blue-light);
background: var(--grey-3);
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<script>
import { Multiselect } from "@budibase/bbui"

export let options = []
export let value = []
export let styleBindingProperty
export let onChange = () => {}

let boundValue = getValidOptions(value, options)
$: setValue(boundValue)
$: sanitiseOptions(options)

function getValidOptions(selectedOptions, allOptions) {
// Fix the hardcoded default string value
if (!Array.isArray(selectedOptions)) {
selectedOptions = []
}
return selectedOptions.filter(val => allOptions.indexOf(val) !== -1)
}

function setValue(val) {
onChange(val)
}

function sanitiseOptions(options) {
boundValue = getValidOptions(value, options)
}
</script>

<div>
<Multiselect extraThin secondary bind:value={boundValue}>
{#each options as option}
<option value={option}>{option}</option>
{/each}
</Multiselect>
</div>

<style>
div {
flex: 1 1 auto;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script>
import TableViewFieldSelect from "./TableViewFieldSelect.svelte"
</script>

<TableViewFieldSelect {...$$props} multiselect />
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script>
import { onMount, beforeUpdate, afterUpdate } from "svelte"
import { onMount } from "svelte"
import Portal from "svelte-portal"
import { buildStyle } from "../../helpers.js"

export let options = []
export let value = ""
export let styleBindingProperty
export let onChange = value => {}
export let onChange = () => {}

let open = null
let rotate = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

let temp = runtimeToReadableBinding(bindableProperties, value)

return !value && props.defaultValue !== undefined
return value == null && props.defaultValue !== undefined
? props.defaultValue
: temp
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
control={definition.control}
label={definition.label}
key={definition.key}
value={componentInstance[definition.key] || componentInstance[definition.key]?.defaultValue}
value={componentInstance[definition.key] ?? componentInstance[definition.key]?.defaultValue}
{componentInstance}
{onChange}
props={{ ...excludeProps(definition, ['control', 'label']) }} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<script>
import OptionSelect from "./OptionSelect.svelte"
import { backendUiStore } from "builderStore"
import { onMount } from "svelte"
import MultiOptionSelect from "./MultiOptionSelect.svelte"

export let componentInstance = {}
export let value = ""
export let onChange = (val = {})
export let onChange = () => {}
export let multiselect = false

const tables = $backendUiStore.tables

Expand All @@ -24,4 +25,8 @@
}
</script>

<OptionSelect {value} {onChange} {options} />
{#if multiselect}
<MultiOptionSelect {value} {onChange} {options} />
{:else}
<OptionSelect {value} {onChange} {options} />
{/if}
Loading