Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion web-common/src/components/vega/VegaLiteRenderer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
<div
bind:contentRect
role="presentation"
class:px-2={canvasDashboard}
class="rill-vega-container overflow-y-auto overflow-x-hidden size-full flex flex-col items-center"
on:mouseleave={handleMouseLeave}
>
Expand Down
3 changes: 3 additions & 0 deletions web-common/src/components/vega/vega-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export const getRillTheme: (
autosize: {
type: "fit-x",
},
...(isCanvasDashboard && {
padding: 0,
}),
background: "transparent",
mark: {
tooltip: isCanvasDashboard,
Expand Down
6 changes: 3 additions & 3 deletions web-common/src/features/canvas/CanvasComponent.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@
class:editable
class:opacity-20={ghost}
style:pointer-events={!allowPointerEvents ? "none" : "auto"}
class:outline={allowBorder || open}
class:shadow-sm={allowBorder || open}
class="group component-card size-full flex flex-col cursor-pointer z-10 p-0 relative outline-[1px] outline-border bg-surface-card overflow-hidden rounded-sm"
class:shadow={allowBorder || open}
class="group component-card size-full flex flex-col cursor-pointer z-10 p-0 relative bg-surface-card overflow-hidden rounded-sm border border-border"
>
<Toolbar
{component}
Expand All @@ -84,6 +83,7 @@
<div
role="presentation"
class="size-full grow flex flex-col"
class:p-4={allowBorder}
on:mousedown={onMouseDown}
>
{#if component}
Expand Down
11 changes: 5 additions & 6 deletions web-common/src/features/canvas/ComponentHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{#if title || description}
<div
bind:this={container}
class="component-header-container w-full h-fit flex flex-col bg-surface-card px-4 pt-2 pb-1 items-start {wide
class="component-header-container w-full h-fit flex flex-col bg-surface-card items-start {wide
? 'wide'
: ''}"
>
Expand Down Expand Up @@ -85,7 +85,7 @@
{/if}
</div>
{:else if atleastOneFilter}
<div class="w-full px-2 py-1">
<div class="w-full">
<LocalFiltersHeader {component} />
</div>
{/if}
Expand All @@ -104,10 +104,9 @@
}

.title {
font-size: 15px;
line-height: 26px;
@apply flex-shrink-0;
@apply font-medium text-fg-primary truncate;
font-size: 16px;
@apply flex-shrink-0 leading-none;
@apply font-semibold text-fg-primary truncate;
}

.title.faint {
Expand Down
22 changes: 12 additions & 10 deletions web-common/src/features/canvas/components/charts/CanvasChart.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
};
</script>

<div class="size-full flex flex-col overflow-hidden">
<div class="size-full flex flex-col overflow-hidden gap-y-4">
{#if schema.isValid}
{#if isFetching}
<div class="flex items-center justify-center h-full w-full">
Expand All @@ -97,15 +97,17 @@
{filters}
{component}
/>
<Chart
{chartType}
{chartSpec}
{chartData}
measures={$measures}
isCanvas
themeMode={$isThemeModeDark ? "dark" : "light"}
theme={currentTheme}
/>
<div class="grow overflow-hidden">
<Chart
{chartType}
{chartSpec}
{chartData}
measures={$measures}
isCanvas
themeMode={$isThemeModeDark ? "dark" : "light"}
theme={currentTheme}
/>
</div>
{/if}
{:else}
<ComponentError error={schema.error} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,93 +147,92 @@
$: ({ parsed } = mvFilters);
</script>

{#if schema.isValid}
<ComponentHeader
{component}
{title}
{description}
showDescriptionAsTooltip={show_description_as_tooltip}
{filters}
/>
<div class="size-full flex flex-col overflow-hidden gap-y-4">
{#if schema.isValid}
<ComponentHeader
{component}
{title}
{description}
showDescriptionAsTooltip={show_description_as_tooltip}
{filters}
/>

<div
class="h-fit p-0 grow relative"
class:!p-0={visibleDimensions.length === 1}
>
<span class="border-overlay" />
<div
class="grid-wrapper gap-px overflow-x-auto"
style:grid-template-columns="repeat(auto-fit, minmax({estimatedTableWidth +
LEADERBOARD_WRAPPER_PADDING}px, 1fr))"
>
{#each visibleDimensions as dimension (dimension.name)}
{#if dimension.name}
<div
class="leaderboard-wrapper"
bind:clientWidth={leaderboardWrapperWidth}
>
<Leaderboard
leaderboardShowContextForAllMeasures
timeControlsReady
slice={numRows}
visible={$visible}
{isValidPercentOfTotal}
{metricsViewName}
leaderboardSortByMeasureName={leaderboardSortByMeasureName ??
leaderboardMeasureNames?.[0]}
leaderboardMeasures={visibleMeasures}
{whereFilter}
{dimensionThresholdFilters}
tableWidth={dimensionColumnWidth + totalContextWidth}
{dimensionColumnWidth}
sortedAscending={sortDirection === SortDirection.ASCENDING}
{sortType}
filterExcludeMode={$parsed?.dimensionFilters.get(dimension.name)
?.isInclude === false}
{timeRange}
comparisonTimeRange={showTimeComparison
? comparisonTimeRange
: undefined}
{dimension}
allowExpandTable={false}
allowDimensionComparison={false}
selectedValues={selectedDimensionValues(
runtimeClient,
[metricsViewName],
whereFilter,
dimension.name,
timeRange.start,
timeRange.end,
)}
isBeingCompared={false}
formatters={measureFormatters}
{toggleSort}
toggleDimensionValueSelection={async (
name,
value,
keepPillVisible,
isExclusiveFilter,
) => {
await toggleDimensionValueSelections(
name,
[value],
<div class="p-0 grow relative">
<span class="border-overlay" />
<div
class="grid-wrapper gap-px overflow-x-auto"
style:grid-template-columns="repeat(auto-fit, minmax({estimatedTableWidth +
LEADERBOARD_WRAPPER_PADDING}px, 1fr))"
>
{#each visibleDimensions as dimension (dimension.name)}
{#if dimension.name}
<div
class="leaderboard-wrapper"
bind:clientWidth={leaderboardWrapperWidth}
>
<Leaderboard
leaderboardShowContextForAllMeasures
timeControlsReady
slice={numRows}
visible={$visible}
{isValidPercentOfTotal}
{metricsViewName}
leaderboardSortByMeasureName={leaderboardSortByMeasureName ??
leaderboardMeasureNames?.[0]}
leaderboardMeasures={visibleMeasures}
{whereFilter}
{dimensionThresholdFilters}
tableWidth={dimensionColumnWidth + totalContextWidth}
{dimensionColumnWidth}
sortedAscending={sortDirection === SortDirection.ASCENDING}
{sortType}
filterExcludeMode={$parsed?.dimensionFilters.get(dimension.name)
?.isInclude === false}
{timeRange}
comparisonTimeRange={showTimeComparison
? comparisonTimeRange
: undefined}
{dimension}
allowExpandTable={false}
allowDimensionComparison={false}
selectedValues={selectedDimensionValues(
runtimeClient,
[metricsViewName],
whereFilter,
dimension.name,
timeRange.start,
timeRange.end,
)}
isBeingCompared={false}
formatters={measureFormatters}
{toggleSort}
toggleDimensionValueSelection={async (
name,
value,
keepPillVisible,
isExclusiveFilter,
);
}}
measureLabel={(measureName) =>
visibleMeasures.find((m) => m.name === measureName)
?.displayName || measureName}
/>
</div>
{/if}
{/each}
) => {
await toggleDimensionValueSelections(
name,
[value],
[metricsViewName],
keepPillVisible,
isExclusiveFilter,
);
}}
measureLabel={(measureName) =>
visibleMeasures.find((m) => m.name === measureName)
?.displayName || measureName}
/>
</div>
{/if}
{/each}
</div>
</div>
</div>
{:else}
<ComponentError error={schema.error} />
{/if}
{:else}
<ComponentError error={schema.error} />
{/if}
</div>

<style lang="postcss">
.grid-wrapper {
Expand All @@ -242,7 +241,7 @@
}

.leaderboard-wrapper {
@apply relative p-4 pr-6 grid outline outline-1 outline-gray-200;
@apply relative grid outline outline-1 outline-border;
}

.border-overlay {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,20 @@
}
</script>

<ComponentHeader
{component}
{title}
{description}
showDescriptionAsTooltip={show_description_as_tooltip}
{filters}
/>
<div class="size-full flex flex-col overflow-hidden gap-y-4">
<ComponentHeader
{component}
{title}
{description}
showDescriptionAsTooltip={show_description_as_tooltip}
{filters}
/>

<CanvasPivotRenderer
{hasHeader}
{schema}
{pivotDataStore}
pivotConfig={config}
{pivotState}
/>
<CanvasPivotRenderer
{hasHeader}
{schema}
{pivotDataStore}
pivotConfig={config}
{pivotState}
/>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@
pivotColumns.dimension.length > 0 && pivotColumns.measure.length === 0;
</script>

<div
class="size-full overflow-hidden"
style:max-height="inherit"
class:p-4={hasHeader}
class:pt-1={hasHeader}
>
<div class="size-full overflow-hidden" style:max-height="inherit">
{#if !schema.isValid}
<ComponentError error={schema.error} />
{:else if pivotDataStore && $pivotDataStore && pivotConfig && $pivotConfig}
Expand Down
Loading