-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
181 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
web-common/src/features/canvas/inspector/ChartTypeSelector.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<script lang="ts"> | ||
import { Button } from "@rilldata/web-common/components/button"; | ||
import InputLabel from "@rilldata/web-common/components/forms/InputLabel.svelte"; | ||
import Tooltip from "@rilldata/web-common/components/tooltip/Tooltip.svelte"; | ||
import TooltipContent from "@rilldata/web-common/components/tooltip/TooltipContent.svelte"; | ||
import type { ChartMetadata } from "@rilldata/web-common/features/canvas/components/charts/types"; | ||
import { chartMetadata } from "@rilldata/web-common/features/canvas/components/charts/util"; | ||
import { type CanvasComponentType } from "@rilldata/web-common/features/canvas/components/types"; | ||
import { | ||
isChartComponentType, | ||
type CanvasComponentObj, | ||
} from "@rilldata/web-common/features/canvas/components/util"; | ||
export let componentType: CanvasComponentType; | ||
export let component: CanvasComponentObj; | ||
async function selectChartType(chartType: ChartMetadata) { | ||
component.updateChartType(chartType.id); | ||
} | ||
</script> | ||
|
||
{#if isChartComponentType(componentType)} | ||
<div class="section"> | ||
<InputLabel label="Chart type" id="chart-components" /> | ||
<div class="chart-icons"> | ||
{#each chartMetadata as chart} | ||
<Tooltip distance={8} location="right"> | ||
<Button | ||
square | ||
small | ||
type="secondary" | ||
selected={componentType === chart.id} | ||
on:click={() => selectChartType(chart)} | ||
> | ||
<svelte:component this={chart.icon} size="20px" /> | ||
</Button> | ||
<TooltipContent slot="tooltip-content"> | ||
{chart.title} | ||
</TooltipContent> | ||
</Tooltip> | ||
{/each} | ||
</div> | ||
</div> | ||
{/if} | ||
|
||
<style lang="postcss"> | ||
.section { | ||
@apply flex flex-col gap-y-2; | ||
} | ||
.chart-icons { | ||
@apply flex border-2 px-2 py-1 gap-x-4; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.