Skip to content
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
316 commits
Select commit Hold shift + click to select a range
cfbc2de
add basic sticky header
ken-zlai Oct 21, 2024
b79d56a
bulk out sticky header section
ken-zlai Oct 21, 2024
054127d
add transition to sticky header
ken-zlai Oct 21, 2024
3ff117f
proper bottom margin
ken-zlai Oct 21, 2024
d445826
add @internationalized/date
ken-zlai Oct 22, 2024
73f9bfc
add shadcn Calendar, Popover, RangeCalendar
ken-zlai Oct 22, 2024
e9ad4a7
add ui for date range selector calendar (no functionality)
ken-zlai Oct 22, 2024
ec2368f
functional date range calendar (without error handling)
ken-zlai Oct 22, 2024
09b614b
better variable name
ken-zlai Oct 22, 2024
ca7c47b
more robust checking to show sticky header
ken-zlai Oct 23, 2024
4e449f2
create a function to get date range easier
ken-zlai Oct 23, 2024
533f37d
open the calendar when custom is selected
ken-zlai Oct 23, 2024
619945a
change var name
ken-zlai Oct 23, 2024
fe2d132
if they select custom, update url params after they choose a range
ken-zlai Oct 23, 2024
63fa412
set the select value back to what it was if they dont choose a calend…
ken-zlai Oct 23, 2024
e5a820d
adjust some styles
ken-zlai Oct 23, 2024
82ef796
change sidebar logic/ui to show overlapping points
ken-zlai Oct 23, 2024
27cbeb8
functions to make code more readable
ken-zlai Oct 23, 2024
9a62116
show correct series name
ken-zlai Oct 23, 2024
6763906
basic implementation to click to specific series page after overlap
ken-zlai Oct 23, 2024
4339986
v1 percentile chart w/ sample data (not finished)
ken-zlai Oct 23, 2024
94fcbc2
ensure proper merge of data
ken-zlai Oct 23, 2024
b8ad26d
improve x axis formatting
ken-zlai Oct 23, 2024
64e57b7
fix type issue
ken-zlai Oct 23, 2024
5c93f5d
proper type for series
ken-zlai Oct 23, 2024
6d64546
add FeatureResponse, create function to process data
ken-zlai Oct 23, 2024
ea13e9c
create a function to centralize date range related query paramaters
ken-zlai Oct 23, 2024
e379cb7
better logic/reuse in DateRangeSelector
ken-zlai Oct 24, 2024
14e9d5b
align popover start
ken-zlai Oct 24, 2024
f9edc41
show percentile chart in sidebar
ken-zlai Oct 24, 2024
421cb1b
rename variables
ken-zlai Oct 24, 2024
d2cd5ef
change max width
ken-zlai Oct 24, 2024
007f712
rename variables
ken-zlai Oct 24, 2024
6796706
change default metricType
ken-zlai Oct 24, 2024
5d964ba
add RawComparedFeatureResponse type
ken-zlai Oct 24, 2024
c4f44bb
simple sample data for continuous data comparison
ken-zlai Oct 24, 2024
b956d6c
v1 chart for comparing numerical datasets
ken-zlai Oct 24, 2024
ec03687
change tooltip trigger type
ken-zlai Oct 24, 2024
5bbffee
adjust sample data and y axis ranges
ken-zlai Oct 24, 2024
3f45736
show a sample categorical chart option
ken-zlai Oct 24, 2024
21f31e1
add titles
ken-zlai Oct 24, 2024
e6f3d98
ensure percentile chart data is reactive
ken-zlai Oct 25, 2024
d1bb207
style back button
ken-zlai Oct 25, 2024
e89f26e
text styles in sidebar
ken-zlai Oct 25, 2024
45af58f
change x button top measurement
ken-zlai Oct 25, 2024
cf731af
confine tooltip in percentile chart
ken-zlai Oct 25, 2024
b1978b8
date picker size
ken-zlai Oct 25, 2024
604a53b
icon in learn button
ken-zlai Oct 25, 2024
8e0b23d
make sticky header show as soon as both button sections are off the s…
ken-zlai Oct 25, 2024
fc8054c
add shadcn input
ken-zlai Oct 25, 2024
622f828
get labels dynamically for percentile data
ken-zlai Oct 25, 2024
47bb26e
only show p5, p50, and p95 percentiles
ken-zlai Oct 25, 2024
91f5bda
change TimeSeriesItem format
ken-zlai Oct 25, 2024
c4ab523
use undefined syntax instead of null for label
ken-zlai Oct 25, 2024
9831202
if there is only one data point select it by default
ken-zlai Oct 25, 2024
ff1bc37
remove sample data point
ken-zlai Oct 28, 2024
b0c8d2e
remove old import stuff
ken-zlai Oct 28, 2024
3a624e1
move height/width logic to EChart.svelte
ken-zlai Oct 28, 2024
42262de
add a test for getFeatureTimeseries
ken-zlai Oct 28, 2024
98c8345
Merge branch 'main' into frontend-8/18-milestone
ken-zlai Oct 28, 2024
de50ba0
define typography styles
ken-zlai Oct 28, 2024
4e44a48
add d3
ken-zlai Oct 29, 2024
7f5ffcd
add primary color palette
ken-zlai Oct 29, 2024
2970881
use new colors in sidebar nav
ken-zlai Oct 29, 2024
40a5697
create helper function to convert css color to hex
ken-zlai Oct 29, 2024
a9ff6a7
use primary color in echarts
ken-zlai Oct 29, 2024
53cb3e7
adjust primary colors
ken-zlai Oct 29, 2024
c4234e9
add zipline icons
ken-zlai Oct 29, 2024
228e3a6
match DriftSkewToggle to figma
ken-zlai Oct 29, 2024
6953675
use correct monitoring icon
ken-zlai Oct 29, 2024
003ca39
add neutral and warning colors
ken-zlai Oct 29, 2024
efc64f9
helper function to create a color scale
ken-zlai Oct 29, 2024
9fe805b
use createColorScale function
ken-zlai Oct 29, 2024
75aedf5
styles for tabs-trigger
ken-zlai Oct 29, 2024
cb07af8
make sure main content border doesnt show over separator borders
ken-zlai Oct 29, 2024
9a53dd3
change default color scale options
ken-zlai Oct 29, 2024
0d01d71
no longer need to pass default
ken-zlai Oct 29, 2024
d3ef1ec
different logic for active route
ken-zlai Oct 29, 2024
4388709
outline button has transparent background
ken-zlai Oct 29, 2024
a06db55
date range picker range styles
ken-zlai Oct 29, 2024
8209f0a
styles for left/right button in calendar
ken-zlai Oct 29, 2024
ec87280
use different neutral colors for elevation
ken-zlai Oct 29, 2024
1466f7a
update colors
ken-zlai Oct 29, 2024
caba9c7
use css var
ken-zlai Oct 29, 2024
7729bef
sidebar styling
ken-zlai Oct 29, 2024
65eab78
let user open search dialog w/ shortcut
ken-zlai Oct 29, 2024
81cc240
start styling search
ken-zlai Oct 30, 2024
d507936
update comment
ken-zlai Oct 30, 2024
842f7b0
tailwind vars and sidebar styles
ken-zlai Oct 30, 2024
6bdb19c
shared style for nav button
ken-zlai Oct 30, 2024
9d620ce
reset command
ken-zlai Oct 30, 2024
02d3a17
dont use button, use command item
ken-zlai Oct 30, 2024
04634b6
first svg in command item gets mr-2
ken-zlai Oct 30, 2024
d81e44e
bulk out initial view section
ken-zlai Oct 30, 2024
5b6cdf0
show what term they searched for
ken-zlai Oct 30, 2024
1e88db4
styles for command elements
ken-zlai Oct 30, 2024
a017b20
border bottom to command items
ken-zlai Oct 30, 2024
6089bed
show pointer on non disabled items
ken-zlai Oct 30, 2024
849c210
better approach to handle leading/trailing icon case
ken-zlai Oct 30, 2024
b2dea1f
better logic to handle date ranges (more extensible)
ken-zlai Oct 30, 2024
2c6f49e
use predefined past date ranges
ken-zlai Oct 30, 2024
1aee64f
adjust size of left date range selector to content
ken-zlai Oct 30, 2024
6f19561
dont make collabsibletrigger full width
ken-zlai Oct 30, 2024
69fb457
adjust styling of daterangeselector
ken-zlai Oct 30, 2024
b244f8c
narrow weekday format
ken-zlai Oct 30, 2024
afdcfc2
make border-left transparent
ken-zlai Oct 30, 2024
5524c51
create sizes of the collapsible section
ken-zlai Oct 30, 2024
5d3f697
adjust padding left from title
ken-zlai Oct 30, 2024
43fcbc8
adjust collapsible section spacing
ken-zlai Oct 30, 2024
ce836ab
remove divs to make content center
ken-zlai Oct 30, 2024
bfbdad8
adjust tooltip styles
ken-zlai Oct 30, 2024
968f1c0
create reusable info tooltip
ken-zlai Oct 30, 2024
8435bbb
make maxWidth optional
ken-zlai Oct 30, 2024
09040da
remove border from success variant
ken-zlai Oct 31, 2024
084a32e
create TrueFalseBadge
ken-zlai Oct 31, 2024
6299309
use TrueFalseBadge
ken-zlai Oct 31, 2024
cfe1532
create a basic metadata table
ken-zlai Oct 31, 2024
86554ae
only show table if there is a model
ken-zlai Oct 31, 2024
ab83a16
adjust sticky header stuff
ken-zlai Oct 31, 2024
b7b43d3
line styles
ken-zlai Oct 31, 2024
739be87
enable zoom on categorical chart
ken-zlai Nov 1, 2024
c2c58c2
v1 of custom chart legend
ken-zlai Nov 1, 2024
7ba9ef8
tighter styling
ken-zlai Nov 1, 2024
1102182
more styles
ken-zlai Nov 1, 2024
ab9ad46
share styles
ken-zlai Nov 1, 2024
b42b394
for some reason we need !important on legend-btn styles
ken-zlai Nov 1, 2024
f363773
use flex instead of relative
ken-zlai Nov 1, 2024
374342f
make buttons align vertically center
ken-zlai Nov 1, 2024
0dbe994
show expand button only if there is overflow
ken-zlai Nov 1, 2024
67017fd
adjust max h
ken-zlai Nov 1, 2024
fa9c09f
adjust legend dots to be of proper width
ken-zlai Nov 1, 2024
d1b440b
adjust top margin
ken-zlai Nov 1, 2024
62817b1
better treatment if not shown
ken-zlai Nov 1, 2024
d0784c7
refactor for better code
ken-zlai Nov 1, 2024
9ba241e
only show shortcut after detecting the user agent
ken-zlai Nov 4, 2024
440fc92
use proper button in driftskew toggle
ken-zlai Nov 4, 2024
857bca3
add nullcheck to color
ken-zlai Nov 4, 2024
797b515
componentize action buttons
ken-zlai Nov 4, 2024
b0d615b
add cluster to action buttons
ken-zlai Nov 4, 2024
6fe6b5e
add example to cluster by groupbys
ken-zlai Nov 4, 2024
330df46
use action buttons in feature monitoring section
ken-zlai Nov 4, 2024
e178be0
more spacing
ken-zlai Nov 4, 2024
a033175
basic tooltip styles
ken-zlai Nov 4, 2024
5d0b038
tooltip code to keep consistent styling across all charts
ken-zlai Nov 4, 2024
2163503
move out the observability stuff
ken-zlai Nov 4, 2024
f19db74
chart line color
ken-zlai Nov 4, 2024
aa5245f
remove the / route content, and make /models the default
ken-zlai Nov 4, 2024
eb53b23
change breadcrumb stuff
ken-zlai Nov 4, 2024
9128940
fix issue calling getCssColorAsHex
ken-zlai Nov 4, 2024
0187051
ensure zoom is applied to charts after they are unhidden
ken-zlai Nov 4, 2024
2f82646
move action buttons, let props specify class
ken-zlai Nov 4, 2024
b6a7c28
remove console.log
ken-zlai Nov 4, 2024
ab40686
navigation bar, logo
ken-zlai Nov 6, 2024
956cba9
update typography styles
ken-zlai Nov 6, 2024
19f247b
close ui match on models page
ken-zlai Nov 6, 2024
76f4aa9
add font smoothing
ken-zlai Nov 6, 2024
1722e7c
let user specify table density
ken-zlai Nov 7, 2024
efc4e95
Merge branch 'main' into figma-match
ken-zlai Nov 7, 2024
ba6bffc
upload full font files
ken-zlai Nov 7, 2024
8453190
breadcrumb updates
ken-zlai Nov 7, 2024
cc05376
more style matching
ken-zlai Nov 7, 2024
a3cd651
adjust tooltip styles
ken-zlai Nov 7, 2024
04f58a7
tabs
ken-zlai Nov 7, 2024
e970b52
collapsible margin
ken-zlai Nov 7, 2024
408f7db
add animation to chart legend
ken-zlai Nov 7, 2024
6635741
nicer animation on the text
ken-zlai Nov 7, 2024
ef7bf62
make sure button shows when expanding/collapsing
ken-zlai Nov 7, 2024
37912e2
make sure groupSectionStates is correct
ken-zlai Nov 7, 2024
5a08df5
fix weird css text override
ken-zlai Nov 7, 2024
b71b786
model performance tooltip text
ken-zlai Nov 7, 2024
23719d4
custom colors for chart
ken-zlai Nov 7, 2024
5bafe05
reset zoom button
ken-zlai Nov 7, 2024
356bc17
correct z index
ken-zlai Nov 7, 2024
9fb0e49
border on table items
ken-zlai Nov 7, 2024
ef25cd7
separator under table
ken-zlai Nov 7, 2024
f08fc28
custom tailwind merge w/ typography classes
ken-zlai Nov 7, 2024
67ef416
table head to use regular font
ken-zlai Nov 7, 2024
4bac870
move investigation charts to a dialog
ken-zlai Nov 8, 2024
6d878ca
default height for charts
ken-zlai Nov 8, 2024
df6dbee
change header
ken-zlai Nov 8, 2024
5ea79d1
put dialog content in their own sections
ken-zlai Nov 8, 2024
4fb6188
add selected group by chart to the dialog
ken-zlai Nov 8, 2024
c21228c
autofocus the first button in list
ken-zlai Nov 8, 2024
e55fa5b
use on:click since it is more stable
ken-zlai Nov 8, 2024
ed4fb19
properly show/hide tooltips depending if sheet is open
ken-zlai Nov 8, 2024
2bd9db6
message about overlapping points
ken-zlai Nov 8, 2024
7de86a3
use info tooltip
ken-zlai Nov 8, 2024
20daf42
remove back button
ken-zlai Nov 8, 2024
2c80bda
remove unused import
ken-zlai Nov 8, 2024
93dbb19
proper text in search bar
ken-zlai Nov 8, 2024
2344795
add controls in dialog
ken-zlai Nov 8, 2024
cb071a6
connect percentile chart
ken-zlai Nov 8, 2024
3f77bbf
new current vs baseline chart
ken-zlai Nov 8, 2024
cfa7a62
null ratio chart
ken-zlai Nov 8, 2024
9fb2565
programmatically generate sample data
ken-zlai Nov 8, 2024
2eb0eb6
reset current zoom state
ken-zlai Nov 8, 2024
c4bd73f
dont let user zoom null ratio chart
ken-zlai Nov 8, 2024
c2d1a29
let user zoom current vs baseline chart
ken-zlai Nov 8, 2024
411aafd
fix scroll area padding
ken-zlai Nov 8, 2024
b782e51
adjust padding
ken-zlai Nov 8, 2024
6f81e6e
x button styles
ken-zlai Nov 8, 2024
61a38d1
fix zoom scroll issue
ken-zlai Nov 8, 2024
4209214
fix typo
ken-zlai Nov 8, 2024
1ce45f6
height of reset button
ken-zlai Nov 8, 2024
79bfc57
change relative time options
ken-zlai Nov 9, 2024
c935c0a
change title
ken-zlai Nov 11, 2024
3a6853e
double click to reset zoom
ken-zlai Nov 12, 2024
671a5fb
create utility function to determine if mac
ken-zlai Nov 19, 2024
d9e9987
v1 custom tooltip
ken-zlai Nov 19, 2024
8cfefab
add logic for better transition animation
ken-zlai Nov 19, 2024
7925682
simpler logic
ken-zlai Nov 19, 2024
63745dd
let user click on tooltip point
ken-zlai Nov 19, 2024
ca0799f
start styling tooltip
ken-zlai Nov 19, 2024
e4aaa5d
less height tooltip
ken-zlai Nov 19, 2024
c129030
better text styles
ken-zlai Nov 19, 2024
8735541
justify between
ken-zlai Nov 19, 2024
57f33ef
move height
ken-zlai Nov 19, 2024
d0fb968
separator
ken-zlai Nov 19, 2024
e492dc7
use badge
ken-zlai Nov 19, 2024
cde7996
let user specify if tooltip is clickable
ken-zlai Nov 19, 2024
1be9f1d
optimize deps
ken-zlai Nov 19, 2024
dfdcd45
dialog close alignment
ken-zlai Nov 20, 2024
14d3db2
more precise matching
ken-zlai Nov 20, 2024
7b23dbd
encodeURIComponent
ken-zlai Nov 20, 2024
3da7141
Merge branch 'main' into figma-match
ken-zlai Nov 20, 2024
1d08a9e
better logic to pre-determine tooltip height
ken-zlai Nov 20, 2024
6e6a198
no need to use create tooltip on charts where custom tooltip is used
ken-zlai Nov 20, 2024
99c1ef9
handle window blur to close tooltip
ken-zlai Nov 20, 2024
4646d6c
add color back to custom tooltip
ken-zlai Nov 20, 2024
1e026f2
dont show color/series name if there is only one line
ken-zlai Nov 20, 2024
d3eda93
add support in custom tooltip for bar charts
ken-zlai Nov 20, 2024
e805abc
add line color to dialog title
ken-zlai Nov 20, 2024
969a364
put series color in dialog picker
ken-zlai Nov 20, 2024
fe14b28
better null checks
ken-zlai Nov 20, 2024
bfb0821
use proper text color
ken-zlai Nov 20, 2024
19b1160
actually use proper text style
ken-zlai Nov 20, 2024
b6aa7c2
create a key badge variant
ken-zlai Nov 20, 2024
19e477c
create key-bg badge variant
ken-zlai Nov 20, 2024
019bb48
share styles better
ken-zlai Nov 20, 2024
a985fd5
show date in title
ken-zlai Nov 20, 2024
246b8e0
set markpoint on clicked chart point
ken-zlai Nov 21, 2024
0403ef8
change to line w/ symbol for mark point
ken-zlai Nov 21, 2024
bf02c0a
line styles
ken-zlai Nov 21, 2024
26bcdb0
add animation duration
ken-zlai Nov 21, 2024
4acb0ae
use style tag for height
ken-zlai Nov 21, 2024
295d92c
use proper color/dash style
ken-zlai Nov 21, 2024
759baf5
Merge branch 'main' into figma-match
ken-zlai Nov 21, 2024
0a3ca2c
clear timeout id
ken-zlai Nov 21, 2024
f27da59
Merge remote-tracking branch 'origin/figma-match' into figma-match
ken-zlai Nov 21, 2024
d0b40a7
Merge branch 'main' into figma-match
ken-zlai Nov 22, 2024
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
804 changes: 785 additions & 19 deletions frontend/package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@
"@sveltejs/kit": "^2.6.2",
"@sveltejs/vite-plugin-svelte": "^4.0.0-next.6",
"@tailwindcss/typography": "^0.5.15",
"@types/d3": "^7.4.3",
"@types/eslint": "^9.6.0",
"@types/lodash": "^4.17.10",
"@types/node": "^22.7.4",
"autoprefixer": "^10.4.20",
"bits-ui": "^0.21.16",
"cmdk-sv": "^0.0.18",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
Expand All @@ -52,8 +54,9 @@
"type": "module",
"dependencies": {
"@types/echarts": "^4.9.22",
"@zipline-ai/icons": "^1.0.2",
"clsx": "^2.1.1",
"cmdk-sv": "^0.0.18",
"d3": "^7.9.0",
"dotenv": "^16.4.5",
"echarts": "^5.5.1",
"lodash": "^4.17.21",
Expand Down
53 changes: 44 additions & 9 deletions frontend/src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,58 @@
}

.dark {
--background: 0 0% 3.9%;
--foreground: 0 0% 98%;
--background: var(--neutral-50);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love that we are parameterizing!

--foreground: 0 0% 100%;

--muted: 0 0% 14.9%;
--muted-foreground: 0 0% 63.9%;
--muted-foreground: var(--neutral-800);
--muted-icon-neutral: var(--neutral-700);
--muted-icon-primary: var(--primary-700);

--popover: 0 0% 3.9%;
--popover-foreground: 0 0% 98%;

--card: 0 0% 3.9%;
--card-foreground: 0 0% 98%;

--border: 0 0% 14.9%;
--border: var(--neutral-300);
--input: 0 0% 14.9%;

--primary: 0 0% 98%;
--primary-foreground: 0 0% 9%;
--neutral-50: 0 0% 5%;
--neutral-100: 0 0% 8%;
--neutral-200: 0 0% 10%;
--neutral-300: 0 0% 13%;
--neutral-400: 0 0% 16%;
--neutral-500: 0 0% 24%;
--neutral-600: 0 0% 32%;
--neutral-700: 0 0% 40%;
--neutral-800: 0 0% 64%;
--neutral-900: 0 0% 80%;
--neutral-950: 0 0% 98%;

--primary-50: 351 24% 6%;
--primary-100: 354 20% 10%;
--primary-200: 349 48% 15%;
--primary-300: 345 62% 19%;
--primary-400: 345 58% 23%;
--primary-500: 346 50% 29%;
--primary-600: 347 45% 37%;
--primary-700: 347 45% 48%;
--primary-800: 345 100% 65%;
--primary-900: 348 100% 78%;
--primary-950: 352 100% 91%;

--warning-50: 41 66% 10%;
--warning-100: 40 29% 8%;
--warning-200: 41 66% 10%;
--warning-300: 41 100% 12%;
--warning-400: 42 100% 14%;
--warning-500: 43 81% 19%;
--warning-600: 42 58% 26%;
--warning-700: 42 56% 34%;
--warning-800: 44 100% 55%;
--warning-900: 45 100% 60%;
--warning-950: 40 100% 86%;

--secondary: 0 0% 14.9%;
--secondary-foreground: 0 0% 98%;
Expand All @@ -70,7 +105,7 @@

@layer base {
* {
@apply border-border;
@apply border-border antialiased;
}
body {
@apply bg-background text-foreground;
Expand All @@ -79,15 +114,15 @@

@font-face {
font-family: 'Geist';
src: url('/fonts/Geist[wght].woff2') format('woff2-variations');
src: url('/fonts/Geist-v1.4.01/webfonts/Geist[wght].woff2') format('woff2-variations');
font-weight: 100 900;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: 'Geist Mono';
src: url('/fonts/GeistMono[wght].woff2') format('woff2-variations');
src: url('/fonts/GeistMono-1.4.01/webfonts/GeistMono[wght].woff2') format('woff2-variations');
font-weight: 100 900;
font-style: normal;
font-display: swap;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en" class="dark">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<link rel="icon" href="%sveltekit.assets%/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
Expand Down
46 changes: 46 additions & 0 deletions frontend/src/lib/components/ActionButtons/ActionButtons.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<script lang="ts">
import { Button } from '$lib/components/ui/button';
import { cn } from '$lib/utils';
import { Icon, Plus, ArrowsUpDown, Square3Stack3d, XMark } from 'svelte-hero-icons';
let { showCluster = false, class: className }: { showCluster?: boolean; class?: string } =
$props();
let activeCluster = showCluster ? 'GroupBys' : null;
</script>

<div class={cn('flex flex-wrap gap-3', className)}>
<!-- Active Items Section -->
{#if activeCluster}
<div class="flex flex-wrap gap-[1px]">
<Button variant="secondaryAlt" size="sm" icon="leading" disabled>
<Icon src={Square3Stack3d} micro size="16" />
Cluster by
</Button>
<Button variant="secondaryAlt" size="sm" disabled>
{activeCluster}
</Button>
<Button variant="secondaryAlt" size="sm" class="p-2" disabled>
<Icon src={XMark} micro size="16" />
</Button>
</div>
{/if}

<!-- Action Buttons Section -->
<div class="flex gap-3">
<Button variant="secondary" size="sm" icon="leading">
<Icon src={Plus} micro size="16" />
Filter
</Button>
<Button variant="secondary" size="sm" icon="leading">
<Icon src={ArrowsUpDown} micro size="16" />
Sort
</Button>
{#if showCluster}
<Button variant="secondary" size="sm" icon="leading">
<Icon src={Square3Stack3d} micro size="16" />
Cluster
</Button>
{/if}
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Breadcrumb class={cn('', className)}>
<BreadcrumbList>
<BreadcrumbItem>
<BreadcrumbLink href="/">Home</BreadcrumbLink>
<BreadcrumbLink href="/">Zipline AI</BreadcrumbLink>
</BreadcrumbItem>
{#each breadcrumbs as crumb, index}
<BreadcrumbSeparator>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,60 @@
} from '$lib/components/ui/collapsible';
import type { Snippet } from 'svelte';
import { Icon, ChevronDown } from 'svelte-hero-icons';
import { stopPropogation } from '$lib/util/event';
let {
collabsibleContent,
collapsibleContent,
headerContentLeft,
headerContentRight,
title,
open = $bindable(true)
open = $bindable(true),
size = 'default'
}: {
collabsibleContent: Snippet;
collapsibleContent: Snippet;
headerContentLeft?: Snippet;
headerContentRight?: Snippet;
title: string;
open: boolean;
size?: 'small' | 'default' | 'large';
} = $props();

const sizeClasses = {
small: {
wrapper: 'mt-6 mb-8',
title: 'text-regular'
},
default: {
wrapper: 'my-8',
title: 'text-large-medium'
},
large: {
wrapper: 'my-12',
title: 'text-xl'
}
}[size];
</script>

<Collapsible bind:open class="mt-9 mb-6">
<div class="flex items-center justify-between mb-4">
<CollapsibleTrigger class="flex items-center space-x-4 w-full">
<Collapsible bind:open class={sizeClasses.wrapper}>
<div class="flex mb-3">
<CollapsibleTrigger class="flex items-center space-x-4">
<Icon
src={ChevronDown}
micro
size="16"
class="transition-transform duration-200 {open ? '' : 'rotate-180'}"
/>
<h2 class="text-lg">{title}</h2>
<h2 class="{sizeClasses.title} !ml-2">{title}</h2>
</CollapsibleTrigger>
<div class="flex items-center justify-between flex-1 ml-2">
{#if headerContentLeft}
<!-- svelte-ignore event_directive_deprecated -->
<div on:click={stopPropogation} role="presentation">
{@render headerContentLeft()}
</div>
{@render headerContentLeft()}
{/if}
</CollapsibleTrigger>
{#if headerContentRight}
<div>
<div></div>
{#if headerContentRight}
{@render headerContentRight()}
</div>
{/if}
{/if}
</div>
</div>
<CollapsibleContent>
{@render collabsibleContent()}
{@render collapsibleContent()}
</CollapsibleContent>
</Collapsible>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="text-center pt-16 px-4">
<h1 class="text-5xl font-bold mb-4">Coming Soon</h1>
<h1 class="text-3xl font-bold mb-4">Coming Soon</h1>
<p class="text-xl">We're working on something exciting. Stay tuned!</p>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<script lang="ts">
import { Button } from '$lib/components/ui/button';
import type { EChartsType } from 'echarts';
import { Icon, ChevronDown, ChevronUp } from 'svelte-hero-icons';
type LegendItem = { feature: string };
type Props = {
groupName: string;
items: Array<LegendItem>;
chart: EChartsType;
};
let { groupName, items, chart }: Props = $props();
let hiddenSeries: { [key: string]: Set<string> } = $state({});
let isExpanded = $state(false);
let itemsContainer: HTMLDivElement;
let containerHeight = $state(0);
let hasOverflow = $state(false);
let containerHeightLine = 24;
function toggleSeries(seriesName: string) {
const groupSet = hiddenSeries[groupName] || new Set();
if (groupSet.has(seriesName)) {
groupSet.delete(seriesName);
} else {
groupSet.add(seriesName);
}
hiddenSeries = {
...hiddenSeries,
[groupName]: groupSet
};
chart.setOption({ legend: { show: false } });
chart.dispatchAction({
type: 'legendToggleSelect',
name: seriesName
});
}
function getSeriesColor(index: number, colors: string[]): string {
return colors[index % colors.length] || '#000000';
}
function checkOverflow() {
if (!itemsContainer) return;
const hasVerticalOverflow = itemsContainer.scrollHeight > itemsContainer.clientHeight;
const hasHorizontalOverflow = itemsContainer.scrollWidth > itemsContainer.clientWidth;
hasOverflow = hasVerticalOverflow || hasHorizontalOverflow;
}
$effect(() => {
if (!itemsContainer) return;
const resizeObserver = new ResizeObserver(() => {
checkOverflow();
containerHeight = itemsContainer.scrollHeight;
});
resizeObserver.observe(itemsContainer);
checkOverflow();
containerHeight = itemsContainer.scrollHeight;
return () => resizeObserver.disconnect();
});
</script>

<div class="relative mt-5">
<div class="flex">
<div
bind:this={itemsContainer}
class={`flex flex-wrap gap-x-8 gap-y-2 flex-1 transition-all duration-150 ease-in-out ${!isExpanded ? 'overflow-hidden' : ''}`}
style="height: {isExpanded ? containerHeight + 'px' : containerHeightLine + 'px'};"
>
{#each items as { feature }, index}
{@const colors = chart?.getOption()?.color || []}
{@const color = getSeriesColor(index, colors)}
{@const isHidden = hiddenSeries[groupName]?.has(feature)}

<Button
class="legend-btn gap-x-2 max-w-[148px]"
variant="ghost"
on:click={() => toggleSeries(feature)}
title={feature}
>
<div
class="w-2 h-2 rounded-full flex-shrink-0"
style="background-color: {isHidden ? 'hsl(var(--neutral-700))' : color}"
></div>
<div
class="{isHidden
? 'text-neutral-700'
: ''} overflow-hidden text-ellipsis whitespace-nowrap"
>
<span>{feature}</span>
</div>
</Button>
{/each}
</div>

{#if hasOverflow || isExpanded || containerHeight > containerHeightLine}
<Button variant="ghost" class="legend-btn" on:click={() => (isExpanded = !isExpanded)}>
<div class="transition-opacity duration-150" class:opacity-0={isExpanded}>
view all ({items.length})
</div>
<div class="transition-opacity duration-150 absolute" class:opacity-0={!isExpanded}>
collapse
</div>
<Icon src={isExpanded ? ChevronUp : ChevronDown} micro size="16" class="ml-2" />
</Button>
{/if}
</div>
</div>

<style lang="postcss">
:global(.legend-btn) {
@apply flex items-center hover:bg-transparent font-normal h-6 p-0 text-sm !important;
}
</style>
Loading
Loading