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

Feat: Visual canvas dashboard #6294

Open
wants to merge 90 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
002a5f9
Remove data resolvers from components
begelundmuller Oct 25, 2024
e873f1e
wip
briangregoryholmes Nov 5, 2024
2b80cff
merge main
briangregoryholmes Nov 5, 2024
0ffe720
wip
briangregoryholmes Nov 7, 2024
27b579f
Merge branch 'main' into bgh/visual-explore-editing
briangregoryholmes Nov 7, 2024
05e361e
create theme input
briangregoryholmes Nov 7, 2024
27729ea
add default case when key not set
briangregoryholmes Nov 7, 2024
add21fd
cleanup
briangregoryholmes Nov 7, 2024
36c1a44
merge main
briangregoryholmes Nov 7, 2024
0c2d217
Merge branch 'main' into bgh/visual-explore-editing
briangregoryholmes Nov 8, 2024
96c827f
cleanup and set defaults feature
briangregoryholmes Nov 8, 2024
a6ce459
test fix
briangregoryholmes Nov 9, 2024
595ffbb
Init canvas screen
djbarnwal Nov 14, 2024
4d25035
uxqa
briangregoryholmes Nov 15, 2024
2a972b2
Merge branch 'main' into bgh/visual-explore-editing
briangregoryholmes Nov 15, 2024
c62f476
uxqa
briangregoryholmes Nov 15, 2024
e17b46d
add tabs for chart options
djbarnwal Nov 18, 2024
8ac6ccb
Working chart
djbarnwal Nov 18, 2024
d610d84
uxqa, exclude mode
briangregoryholmes Nov 18, 2024
0ed000b
Merge branch 'main' into feat/canvas-2.0
djbarnwal Nov 19, 2024
065bc28
Merge branch 'bgh/visual-explore-editing' into feat/canvas-2.0
djbarnwal Nov 19, 2024
a25becc
Update UI to match visual editing
djbarnwal Nov 19, 2024
a289a2f
Remove unused file
djbarnwal Nov 19, 2024
76835a6
Larger icons
djbarnwal Nov 19, 2024
1b356b9
merge main
djbarnwal Nov 24, 2024
e8ca858
Merge branch 'main' into feat/canvas-2.0
djbarnwal Nov 25, 2024
33fa567
Share props
djbarnwal Nov 25, 2024
0512cab
Merge branch 'main' into begelundmuller/remove-component-resolvers
begelundmuller Dec 4, 2024
9ffddc4
Fix test
begelundmuller Dec 4, 2024
a2a4d7f
Add `max_width` and `theme`; remove `gap` and `column`; move `vega_li…
begelundmuller Dec 4, 2024
3434bc0
Add state and visual inspector
djbarnwal Dec 5, 2024
fe72b44
Merge main
djbarnwal Dec 5, 2024
2faedd8
Remove logs
djbarnwal Dec 5, 2024
f4d976b
Add component framework
djbarnwal Dec 10, 2024
97f1b5a
Merge main
djbarnwal Dec 10, 2024
d91c5d3
Fallback for MesaureBigNum for canvas
djbarnwal Dec 10, 2024
f6a3199
Merge branch 'main' into feat/canvas-2.0
djbarnwal Dec 12, 2024
5c548e8
Add input UI
djbarnwal Dec 14, 2024
44b9013
Merge main
djbarnwal Dec 14, 2024
b99aebe
Update schema
djbarnwal Dec 17, 2024
453a46d
Merge branch 'main' into feat/canvas-2.0
djbarnwal Dec 17, 2024
bec6332
Add bar positional inputs
djbarnwal Dec 17, 2024
ee35a13
Remove old import
djbarnwal Dec 18, 2024
4476e5a
Merge main
djbarnwal Dec 18, 2024
6a998c1
Merge branch 'main' into begelundmuller/remove-component-resolvers
begelundmuller Dec 18, 2024
26cc8e3
Remove non required fields from spec
djbarnwal Dec 18, 2024
871b1a8
Merge branch 'begelundmuller/remove-component-resolvers' into feat/ca…
djbarnwal Dec 18, 2024
f237dde
Remove old canvas deprecated properties
djbarnwal Dec 18, 2024
4458b80
Code hygiene
djbarnwal Dec 18, 2024
6e3337b
Remove eslint errors
djbarnwal Dec 19, 2024
fd4020f
Relax types for updating property
djbarnwal Dec 19, 2024
0bb083f
Remove stale code
djbarnwal Dec 19, 2024
70a22a3
Update preview
djbarnwal Dec 19, 2024
40d5875
Merge main
djbarnwal Dec 19, 2024
eb5bcb9
Update file artifact references
djbarnwal Dec 20, 2024
41c2d12
Remove unused prop
djbarnwal Dec 20, 2024
dfe6d62
remove ai chart gen from codebase
djbarnwal Dec 20, 2024
302ca97
Add support for adding component from menu
djbarnwal Dec 20, 2024
f563a09
Fix Go lint and test
begelundmuller Dec 20, 2024
b656cff
Use first metricsView as default
djbarnwal Dec 20, 2024
223d203
Merge remote-tracking branch 'origin/feat/canvas-2.0' into feat/canva…
djbarnwal Dec 20, 2024
ba704d0
Code hygiene
djbarnwal Dec 20, 2024
001b84c
use query for valid spec store
djbarnwal Dec 20, 2024
edd973d
Wait for container dimensions to be available before render
djbarnwal Dec 20, 2024
bab44b4
Fix fileartifact reference in component class
djbarnwal Dec 20, 2024
432bb26
Add theme root class
djbarnwal Dec 20, 2024
5ddd484
Sanitize bindings for inputs
djbarnwal Dec 21, 2024
48ff51e
Update styling for inputs
djbarnwal Dec 21, 2024
a41c459
Sidebar header UI changes
djbarnwal Dec 21, 2024
80477d2
Add small styles for theme input
djbarnwal Dec 21, 2024
98f7523
Add measure titles to charts
djbarnwal Dec 23, 2024
dcea247
Generalize query for chart data
djbarnwal Dec 23, 2024
08fb7ca
add color field input
djbarnwal Dec 23, 2024
456e3dc
Fix xoffset field
djbarnwal Dec 23, 2024
849d56c
Add multi select for measure and dimensions
djbarnwal Dec 23, 2024
0f2a700
Make multi selections removable
djbarnwal Dec 23, 2024
1644b84
Update chart type selector to accomodate new artifact changes
djbarnwal Dec 23, 2024
d4f3157
Merge main
djbarnwal Dec 24, 2024
476d0b5
Lint fix
djbarnwal Dec 24, 2024
242b3eb
Add time filter UI controls
djbarnwal Dec 26, 2024
927a3cf
Use class based store of stores
djbarnwal Dec 27, 2024
9540afe
Update selectors to use chips
djbarnwal Dec 27, 2024
c9c1afa
Lint fix
djbarnwal Dec 27, 2024
a9958ad
Move to new API
djbarnwal Dec 28, 2024
c256aa5
Merge branch 'main' into feat/canvas-2.0
djbarnwal Jan 2, 2025
608828d
Add grain selector
djbarnwal Jan 2, 2025
c0a4357
Separate out filter params in config
djbarnwal Jan 3, 2025
ff2fdea
Remove canvas entities as a store and use class
djbarnwal Jan 3, 2025
9242858
Cleanup
djbarnwal Jan 3, 2025
68673a2
Review
djbarnwal Jan 3, 2025
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
Prev Previous commit
Next Next commit
cleanup and set defaults feature
  • Loading branch information
briangregoryholmes committed Nov 8, 2024
commit 96c827fbf603cd624967b9af6447d3f2c34b7c1a
1 change: 0 additions & 1 deletion web-common/src/features/entity-management/file-artifact.ts
Original file line number Diff line number Diff line change
@@ -316,7 +316,6 @@ export class FileArtifact {
}

private updateResourceNameIfChanged(resource: V1Resource) {
console.log({ resource });
const isSubResource = !!resource.component?.spec?.definedInCanvas;
if (isSubResource) return;

86 changes: 81 additions & 5 deletions web-common/src/features/workspaces/VisualExploreEditing.svelte
Original file line number Diff line number Diff line change
@@ -21,6 +21,8 @@
import TimeRangeInput from "../visual-editing/TimeRangeInput.svelte";
import ThemeInput from "../visual-editing/ThemeInput.svelte";
import type { V1Explore } from "@rilldata/web-common/runtime-client";
import { useExploreStore } from "../dashboards/stores/dashboard-stores";
import type { DashboardTimeControls } from "@rilldata/web-common/lib/time/types";

const itemTypes = ["measures", "dimensions"] as const;

@@ -64,6 +66,7 @@
$: rawTimeZones = parsedDocument.get("time_zones");
$: rawTheme = parsedDocument.get("theme");
$: rawTimeRanges = parsedDocument.get("time_ranges");
$: rawDefaults = parsedDocument.get("defaults");

$: timeZones = new Set(
rawTimeZones instanceof YAMLSeq
@@ -126,6 +129,9 @@
: [],
);

$: defaults =
rawDefaults instanceof YAMLMap ? (rawDefaults.toJSON() as Defaults) : {};

$: measureExpression =
rawMeasures instanceof YAMLMap ? rawMeasures?.get("expr") : "";
$: dimensionExpression =
@@ -145,7 +151,28 @@
? "Custom"
: undefined;

export function isString(value: unknown): value is string {
$: exploreStateStore = useExploreStore(exploreName);

$: exploreStore = $exploreStateStore;

$: newDefaults = constructDefaultState(
exploreStore?.showTimeComparison,
exploreStore?.selectedComparisonDimension,
exploreStore?.visibleDimensionKeys,
exploreStore?.visibleMeasureKeys,
exploreStore?.selectedTimeRange,
);

$: viewingDefaults = Object.entries(defaults).every(([key, value]) => {
if (Array.isArray(value) && Array.isArray(newDefaults[key])) {
return (
JSON.stringify(value.sort()) === JSON.stringify(newDefaults[key].sort())
);
}
return JSON.stringify(value) === JSON.stringify(newDefaults[key]);
});

function isString(value: unknown): value is string {
return typeof value === "string";
}

@@ -173,6 +200,46 @@

await saveContent(parsedDocument.toString());
}

type Defaults = {
measures?: string[];
dimensions?: string[];
comparison_mode?: "time" | "dimension" | "none";
comparison_dimension?: string;
time_comparison?: boolean;
time_range?: string;
};

function constructDefaultState(
showTimeComparison?: boolean,
selectedComparisonDimension?: string | undefined,
visibleDimensionKeys?: Set<string>,
visibleMeasureKeys?: Set<string>,
selectedTimeRange?: DashboardTimeControls | undefined,
): Defaults {
const newDefaults: Defaults = {};

if (showTimeComparison) {
newDefaults.comparison_mode = "time";
} else if (selectedComparisonDimension) {
newDefaults.comparison_mode = "dimension";
newDefaults.comparison_dimension = selectedComparisonDimension;
}

if (visibleDimensionKeys?.size) {
newDefaults.dimensions = Array.from(visibleDimensionKeys);
}

if (visibleMeasureKeys?.size) {
newDefaults.measures = Array.from(visibleMeasureKeys);
}

if (selectedTimeRange) {
newDefaults.time_range = selectedTimeRange.name;
}

return newDefaults;
}
</script>

<div class="flex gap-x-2 size-full">
@@ -333,11 +400,20 @@

<footer
slot="footer"
class="flex flex-col gap-y-2 mt-auto border-t px-5 py-3 w-full"
class="flex flex-col gap-y-2 mt-auto border-t px-5 py-3 w-full text-gray-500"
>
<!-- <button class="text-primary-600 font-medium w-fit">
Use left settings as defaults
</button> -->
{#if viewingDefaults}
<p>Viewing current default state</p>
{:else}
<button
class="text-primary-600 font-medium w-fit"
on:click={async () => {
await updateProperties({ defaults: newDefaults });
}}
>
Use left settings as defaults
</button>
{/if}
<p>
For more options,
<button on:click={switchView} class="text-primary-600 font-medium">
Original file line number Diff line number Diff line change
@@ -44,13 +44,6 @@

$: resourceKind = <ResourceKind | undefined>$resourceName?.kind;

$: console.log(
{ resourceKind },
$inferredResourceKind,
resourceKind,
$resourceName,
);

$: workspace = workspaces.get(resourceKind ?? $inferredResourceKind);

$: extensions =