Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
defd33e
Add a toggle to between Entries and Summary
jaygeorge Jun 25, 2026
0ca55d4
Prevent "Customizing Columns" overlapping the Entries/Summry view option
jaygeorge Jun 25, 2026
22ae732
Move the view to the end
jaygeorge Jun 25, 2026
12610e0
Move the toggle to a different position because it's a bit awkward cl…
jaygeorge Jun 25, 2026
1b952b2
Add data visualisation icon
jaygeorge Jun 25, 2026
01896ad
Hmm move it back. Let's try something else
jaygeorge Jun 26, 2026
0a9518d
Undo some previous layout changes, ready to accept a v6 merge
jaygeorge Jun 26, 2026
71c72dc
Merge branch '6.x' into forms-2-visualize-responses
jaygeorge Jun 26, 2026
0062135
Move entries/summary view back into its position
jaygeorge Jun 26, 2026
b0cf292
Match the new layout of Listing.vue in collections
jaygeorge Jun 26, 2026
763f84c
Filters - small improvement to overflow clipping so keyboard focus ri…
jaygeorge Jun 26, 2026
8d6632b
Remember view preference for entries/summary toggle
jaygeorge Jun 26, 2026
8509c49
wip - pie chart demo
jaygeorge Jun 26, 2026
17b935f
wip - pie chart demo
jaygeorge Jun 26, 2026
1e67e7b
wip - pie chart demo / some accessibility considerations
jaygeorge Jun 26, 2026
d31ac5b
Make widget heading text a tiny bit less dominant
jaygeorge Jun 29, 2026
e1b841a
Option for displaying pie chart labels
jaygeorge Jun 29, 2026
088ef84
Revert "Option for displaying pie chart labels" - I don't think this …
jaygeorge Jun 29, 2026
ed4ba70
This can just be Tailwind for now
jaygeorge Jun 29, 2026
53a0351
Lollipop graph draft
jaygeorge Jun 29, 2026
03eb5f7
Lollipop graph - tidy
jaygeorge Jun 29, 2026
20d99f0
Pie chart - add hover labels
jaygeorge Jun 29, 2026
f74d496
Pie chart - start building pagination demo
jaygeorge Jun 29, 2026
0b380b6
Pie chart - finish pagination demo
jaygeorge Jun 29, 2026
3e3b94a
Make charts themeable
jaygeorge Jun 29, 2026
4419e24
Pie chart - improve single digit alignment
jaygeorge Jun 29, 2026
30acfd9
Charts - improve dark mode
jaygeorge Jun 29, 2026
b9241a1
Charts - improve chart legend
jaygeorge Jun 29, 2026
2be69cd
Charts - improve theming
jaygeorge Jun 29, 2026
7047d1b
Charts - add min height
jaygeorge Jun 29, 2026
46e0ab9
Charts - wip
jaygeorge Jun 29, 2026
69e7995
Add link from "other" to next page
jaygeorge Jun 29, 2026
0dc49bc
Dropdown field type - draft
jaygeorge Jun 30, 2026
96a812d
Dropdown field type - finish
jaygeorge Jun 30, 2026
151a7f4
Change the way we handle layout for the text in bar charts, so that w…
jaygeorge Jun 30, 2026
a815c7d
Change the way we handle layout for the text in lollipop charts, so t…
jaygeorge Jun 30, 2026
6700a46
Opinion field type - start
jaygeorge Jun 30, 2026
2b03af0
Tidy accessibility
jaygeorge Jun 30, 2026
9e39f0d
Opinion field type - draft
jaygeorge Jun 30, 2026
b54877b
Opinion field type - move the numbers down to the bar
jaygeorge Jun 30, 2026
bd6ae73
Opinion field type - wip
jaygeorge Jun 30, 2026
a9a08f9
Opinion field type - tidy
jaygeorge Jun 30, 2026
280ea54
Opinion field type - tidy
jaygeorge Jun 30, 2026
d9e4836
Vertical Bar Chart - Cleaner separation between native CSS / TW
jaygeorge Jun 30, 2026
6d56998
Pie Chart - Cleaner separation between native CSS / TW
jaygeorge Jun 30, 2026
51cd3e5
Charts - tighten up spacing a touch
jaygeorge Jun 30, 2026
beef49b
Image Choice Field Type - start
jaygeorge Jun 30, 2026
e67245b
Image Choice Field Type - start
jaygeorge Jun 30, 2026
2f6a785
Image Choice Field Type - finish
jaygeorge Jun 30, 2026
728a79e
Image Choice Field Type / Pie Chart - start
jaygeorge Jun 30, 2026
4af81d7
Image Choice Field Type / Pie Chart - wip
jaygeorge Jun 30, 2026
e43cc67
Image Choice Field Type / Pie Chart - wip
jaygeorge Jun 30, 2026
0ac7e17
Image Choice Field Type / Pie Chart - wip
jaygeorge Jun 30, 2026
2a4f79b
Image Choice Field Type / Pie Chart - wip
jaygeorge Jun 30, 2026
c3ffe13
Image Choice Field Type / Pie Chart - wip
jaygeorge Jun 30, 2026
8993a58
Image Choice Field Type / Pie Chart - tidy
jaygeorge Jun 30, 2026
9d34007
Image Choice Field Type / Pie Chart - fix accessibility
jaygeorge Jun 30, 2026
ae34f82
Image Choice Field Type / Pie Chart - accessibility improvements
jaygeorge Jun 30, 2026
16edfc6
Image Choice Field Type / Pie Chart - remove color overlay
jaygeorge Jun 30, 2026
ccc3721
Image Choice Field Type / Pie Chart - add chart toggle
jaygeorge Jun 30, 2026
8e46997
Checkboxes Field Type - wip
jaygeorge Jun 30, 2026
249f766
Checkboxes Field Type - wip
jaygeorge Jun 30, 2026
f14d7fa
Checkboxes Field Type - wip
jaygeorge Jun 30, 2026
949b5df
Checkboxes Field Type - finish
jaygeorge Jun 30, 2026
49e4376
Yes / No Field Type - start
jaygeorge Jun 30, 2026
854f0d8
Adjust spacing slightly
jaygeorge Jun 30, 2026
da18066
Yes / No Field Type - add pie chart option
jaygeorge Jun 30, 2026
3a918bf
Dictionary Field Type - wip
jaygeorge Jun 30, 2026
52a3ebb
Dictionary Field Type - wip
jaygeorge Jun 30, 2026
a97fee9
Dictionary Field Type - fix alignment
jaygeorge Jun 30, 2026
fd6f4f2
Dictionary Field Type - tidy
jaygeorge Jun 30, 2026
7c4d0de
Number Field Type - start
jaygeorge Jul 1, 2026
3e55aa3
Charts - consistent optical alignment
jaygeorge Jul 1, 2026
3f0a0c0
Consistent class order
jaygeorge Jul 1, 2026
00e7374
Organise classes by layout > spacing > decoration
jaygeorge Jul 1, 2026
5a32e3a
Number Field Type - wip
jaygeorge Jul 1, 2026
928de27
Number Field Type - finish
jaygeorge Jul 1, 2026
667f867
Star Rating Field Type - start
jaygeorge Jul 1, 2026
df11676
Star Rating Field Type - wip
jaygeorge Jul 1, 2026
4e93254
Star Rating Field Type - wip
jaygeorge Jul 1, 2026
f4203be
Star Rating Field Type - finish
jaygeorge Jul 1, 2026
4d251de
Star Rating Field Type - add paginated demo
jaygeorge Jul 1, 2026
e095029
Small fixes
jaygeorge Jul 1, 2026
4577d7e
Toggle Field Type - wip
jaygeorge Jul 1, 2026
f27177f
Fix alignment bits
jaygeorge Jul 1, 2026
2ada3b1
Toggle Field Type - wip
jaygeorge Jul 1, 2026
df5bed3
Toggle Field Type - finish
jaygeorge Jul 1, 2026
762d745
Tweak alignment for bar charts
jaygeorge Jul 1, 2026
4b4a87f
Tweak alignment for bar charts
jaygeorge Jul 1, 2026
d8e97d9
Charts / add animation for switching chart types - pie chart
jaygeorge Jul 1, 2026
67d2d9a
Charts / add animation for switching chart types - bar chart
jaygeorge Jul 1, 2026
6cc212e
Charts / add animation for switching chart types - make more repeatable
jaygeorge Jul 1, 2026
208e04f
Charts / add animation for switching chart types - speed up bar anima…
jaygeorge Jul 1, 2026
6c7d8cd
Charts / add animation for switching chart types - speed up pie chart…
jaygeorge Jul 1, 2026
b28e5fb
Charts / add animation for switching chart types - nah actually
jaygeorge Jul 2, 2026
7d9424d
Add a small helper attribute for the toggle group to show it has been…
jaygeorge Jul 2, 2026
e9fad36
Greatly simplify chart animation by using has and querying whether th…
jaygeorge Jul 2, 2026
ea6ea60
Remove a load of JS data arrays so it's a nice flat comp for Dunc to …
jaygeorge Jul 2, 2026
8ffb801
Merge branch 'forms-2' into forms-2-visualize-responses
jaygeorge Jul 2, 2026
aba2e87
Add a display mode for responses
jaygeorge Jul 2, 2026
85492a8
Dark pass
jaygeorge Jul 2, 2026
a898655
Dark pass
jaygeorge Jul 2, 2026
3c94813
Dark pass
jaygeorge Jul 2, 2026
7b8fa1e
Dark pass
jaygeorge Jul 2, 2026
794715f
Chart themes
jaygeorge Jul 2, 2026
7f6b00c
Merge branch 'forms-2' into forms-2-visualize-responses
jaygeorge Jul 2, 2026
68587f6
Bring over field numbers control (not working because of static mockup)
jaygeorge Jul 2, 2026
3b960c7
Switch to a vertical bar chart for stars when greater than 5 star rating
jaygeorge Jul 3, 2026
f5b7f12
Responsive tweaks
jaygeorge Jul 3, 2026
a1e58db
Create a hook for classes inside a button
jaygeorge Jul 3, 2026
84672b1
Hide the filter text with an sr class for mobile
jaygeorge Jul 3, 2026
b204ef8
Add flex-wrap to filter layout so that it doesn't cause overflow on m…
jaygeorge Jul 3, 2026
23424fa
Consistent spacing
jaygeorge Jul 3, 2026
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
24 changes: 24 additions & 0 deletions .storybook/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ manually copy them here.
--theme-color-ui-accent-bg: oklch(0.457 0.24 277.023);
--theme-color-ui-accent-text: var(--theme-color-ui-accent-bg);
--theme-color-switch-bg: var(--theme-color-ui-accent-bg);
--theme-color-chart-1: oklch(0.585 0.233 277.117);
--theme-color-chart-2: oklch(0.274 0.006 286.033);
--theme-color-chart-3: oklch(0.768 0.233 130.85);
--theme-color-chart-4: oklch(0.87 0.065 274.039);
--theme-color-chart-1-label-bg: oklch(0.511 0.262 276.966);
--theme-color-chart-2-label-bg: transparent;
--theme-color-chart-3-label-bg: oklch(0.648 0.2 131.684);
--theme-color-chart-4-label-bg: oklch(0.673 0.182 276.935);
--theme-color-chart-1-legend: oklch(0.585 0.233 277.117);
--theme-color-chart-2-legend: oklch(0.274 0.006 286.033);
--theme-color-chart-3-legend: oklch(0.768 0.233 130.85);
--theme-color-chart-4-legend: oklch(0.785 0.115 274.713);

--z-index-below: -1;
--z-index-above: 1;
Expand All @@ -45,6 +57,18 @@ manually copy them here.
--theme-color-content-bg: oklch(0.21 0.006 285.885);
--theme-color-content-border: oklch(0.141 0.005 285.823);
--theme-color-ui-accent-text: oklch(0.673 0.182 276.935);
--theme-color-chart-1: oklch(0.511 0.262 276.966);
--theme-color-chart-2: oklch(0.87 0.065 274.039);
--theme-color-chart-3: oklch(0.768 0.233 130.85);
--theme-color-chart-4: oklch(0.141 0.005 285.823);
--theme-color-chart-1-label-bg: oklch(0.457 0.24 277.023);
--theme-color-chart-2-label-bg: oklch(0.673 0.182 276.935);
--theme-color-chart-3-label-bg: oklch(0.648 0.2 131.684);
--theme-color-chart-4-label-bg: oklch(0.37 0.013 285.805);
--theme-color-chart-1-legend: oklch(0.511 0.262 276.966);
--theme-color-chart-2-legend: oklch(0.87 0.065 274.039);
--theme-color-chart-3-legend: oklch(0.768 0.233 130.85);
--theme-color-chart-4-legend: oklch(0.141 0.005 285.823);
}
}

343 changes: 343 additions & 0 deletions resources/css/components/forms/charts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,343 @@
/* GROUP CHARTS / PIE CHART
=================================================== */
.pie-chart-figure {
display: grid;
grid-template-columns: 0.6fr 1fr;
@apply gap-4 p-6;
}

.pie-chart-legend {
@apply pt-4;
}

.pie-chart-legend__list {
@apply grid gap-2.25 text-xs text-gray-700 dark:text-gray-50;
}

.pie-chart-legend__item {
@apply flex items-center gap-2.25;
}

.pie-chart-legend__value {
@apply min-w-7 text-end text-[0.785rem] font-medium;
}

.pie-chart-legend__swatch {
@apply size-2.5 shrink-0 rounded-full;
}

.pie-chart-legend__swatch--1 { @apply bg-chart-1-legend; }
.pie-chart-legend__swatch--2 { @apply bg-chart-2-legend; }
.pie-chart-legend__swatch--3 { @apply bg-chart-3-legend; }
.pie-chart-legend__swatch--4 { @apply bg-chart-4-legend; }

.pie-chart-legend__link {
@apply contents cursor-pointer text-inherit;
}

.pie-chart {
--label-radius: 30%;

position: relative;
width: 9rem;
aspect-ratio: 1 / 1;

/* Slice sizes as unitless numbers (percent of circle). */
--end1: calc(var(--1) * 1%);
--end2: calc((var(--1) + var(--2)) * 1%);
--end3: calc((var(--1) + var(--2) + var(--3)) * 1%);
--end4: 100%;

/* Midpoint angle for each slice (100% = 360deg). */
--angle1: calc(var(--1) * 3.6deg / 2);
--angle2: calc((var(--1) + var(--2) / 2) * 3.6deg);
--angle3: calc((var(--1) + var(--2) + var(--3) / 2) * 3.6deg);
--angle4: calc((var(--1) + var(--2) + var(--3) + var(--4) / 2) * 3.6deg);

&:hover {
.pie-chart__label {
opacity: unset;
}
}
}

.pie-chart__disc {
position: relative;
width: 100%;
height: 100%;
border-radius: 50%;
background-image: conic-gradient(
var(--color-chart-1) 0% var(--end1),
var(--color-chart-2) var(--end1) var(--end2),
var(--color-chart-3) var(--end2) var(--end3),
var(--color-chart-4) var(--end3) var(--end4)
);
}

.pie-chart__label {
--angle: 0deg;
opacity: 0;
transition: opacity 0.2s ease-in 0s;

padding: 0.075rem 0.15rem;
border-radius: 0.25rem;

position: absolute;
left: calc(50% + var(--label-radius) * sin(var(--angle)));
top: calc(50% - var(--label-radius) * cos(var(--angle)));
transform: translate(-50%, -50%);

@apply text-xs font-semibold tabular-nums text-white pointer-events-none;
}

.pie-chart__label--1 { --angle: var(--angle1); background-color: var(--color-chart-1-label-bg); }
.pie-chart__label--2 { --angle: var(--angle2); background-color: var(--color-chart-2-label-bg); }
.pie-chart__label--3 { --angle: var(--angle3); background-color: var(--color-chart-3-label-bg); }
/* Kick the radius out a bit because the label segment is smaller, and it might overlap with the preceding segment. */
.pie-chart__label--4 { --angle: var(--angle4); background-color: var(--color-chart-4-label-bg); --label-radius: 39%; }


/* GROUP CHARTS / PIE CHART / MODIFIERS
=================================================== */
.pie-chart--other-segment {
.pie-chart__label,
&.pie-chart:hover .pie-chart__label {
opacity: 0;
}

.pie-chart__label--4,
&.pie-chart:hover .pie-chart__label--4 {
opacity: 1;
border: 2px solid black;
}

.pie-chart__disc {
background-image: conic-gradient(
hsl(from var(--color-chart-1) h s l / 0.1) 0% var(--end1),
hsl(from var(--color-chart-2) h s l / 0.1) var(--end1) var(--end2),
hsl(from var(--color-chart-3) h s l / 0.1) var(--end2) var(--end3),
var(--color-chart-4) var(--end3) var(--end4)
);
}
}



/* GROUP CHARTS / IMAGE PIE CHART
=================================================== */
.image-pie-chart-figure {
display: grid;
grid-template-columns: 0.6fr 1fr;
@apply gap-4 p-6;
}

.image-pie-chart-legend {
@apply pt-4;
}

.image-pie-chart {
--label-radius: 30%;

position: relative;
width: 9rem;
aspect-ratio: 1 / 1;

/* Midpoint angle for each slice (100% = 360deg). */
--angle1: calc(var(--1) * 3.6deg / 2);
--angle2: calc((var(--1) + var(--2) / 2) * 3.6deg);

&:hover {
.image-pie-chart__label {
opacity: unset;
}
}
}

.image-pie-chart__disc {
position: relative;
width: 100%;
height: 100%;
border-radius: 50%;
overflow: hidden;

@apply bg-gray-200 dark:bg-gray-700;
}

.image-pie-chart__slice {
position: absolute;
inset: 0;
border-radius: 50%;
background-image: var(--image);
background-size: cover;
background-position: center;
}

.image-pie-chart__slice--1 {
--slice-size: calc(var(--1) * 3.6deg);

-webkit-mask-image: conic-gradient(from 0deg, #000 0deg var(--slice-size), transparent var(--slice-size));
mask-image: conic-gradient(from 0deg, #000 0deg var(--slice-size), transparent var(--slice-size));
}

.image-pie-chart__slice--2 {
--slice-start: calc(var(--1) * 3.6deg);
--slice-size: calc(var(--2) * 3.6deg);

-webkit-mask-image: conic-gradient(from var(--slice-start), #000 0deg var(--slice-size), transparent var(--slice-size));
mask-image: conic-gradient(from var(--slice-start), #000 0deg var(--slice-size), transparent var(--slice-size));
}

.image-pie-chart__label {
--angle: 0deg;
opacity: 0;
transition: opacity 0.2s ease-in 0s;

padding: 0.075rem 0.15rem;
border-radius: 0.25rem;

position: absolute;
left: calc(50% + var(--label-radius) * sin(var(--angle)));
top: calc(50% - var(--label-radius) * cos(var(--angle)));
transform: translate(-50%, -50%);

@apply text-xs font-medium tabular-nums text-white pointer-events-none;
}

.image-pie-chart__label--1 { --angle: var(--angle1); background-color: hsl(0 0% 0% / 0.55); }
.image-pie-chart__label--2 { --angle: var(--angle2); background-color: hsl(0 0% 0% / 0.55); }



/* GROUP CHARTS / VERTICAL BAR CHART
=================================================== */
.vertical-bar-chart-figure {
display: grid;
height: 100%;
@apply py-3 px-3;
}

.vertical-bar-chart {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 0.1rem;
height: 100%;
list-style: none;
padding: 0;
}

.vertical-bar-chart__bar {
display: grid;
flex: 1;
grid-template-rows: 1fr auto;
align-items: end;
justify-items: center;
gap: 0.5rem;
min-width: 0;
height: 100%;
}

.vertical-bar-chart__plot {
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
width: 100%;
height: 100%;
min-height: 0;
}

.vertical-bar-chart__value {
@apply mb-1.5 text-[0.785rem] font-medium tabular-nums text-gray-800 dark:text-gray-100;
}

.vertical-bar-chart__fill {
flex: 0 0 calc(var(--value) / var(--max-value) * 100%);
width: 100%;
max-width: 2rem;
border-radius: 0.25rem 0.25rem 0 0;
background-color: var(--color-chart-1);
}

.vertical-bar-chart__scale-label {
@apply min-w-8 rounded-md border border-gray-200 shadow-ui-xs px-1.5 py-0.5 text-center text-[0.785rem] font-medium tabular-nums text-gray-700 dark:border-gray-700 dark:text-gray-300;
}



/* GROUP CHARTS / SUMMARY BAR CHART / ICON STROKES
=================================================== */
/* Note: This is used to style the checkbox icons in the summary bar chart depending on the background contrast. */
.summary-bar-chart__icon-stroke {
color: var(--chart-tick-color);
}

.summary-bar-chart__icon-stroke path:not(:first-child) {
stroke: white;
}

@supports (color: contrast-color(red)) {
.dark .summary-bar-chart__icon-stroke path:not(:first-child) {
stroke: contrast-color(var(--chart-tick-color));
}
}

.summary-bar-chart__icon-stroke--1 { --chart-tick-color: var(--color-chart-1-legend); }
.summary-bar-chart__icon-stroke--2 { --chart-tick-color: var(--color-chart-2-legend); }
.summary-bar-chart__icon-stroke--3 { --chart-tick-color: var(--color-chart-3-legend); }
.summary-bar-chart__icon-stroke--4 { --chart-tick-color: var(--color-chart-4-legend); }



/* GROUP CHARTS / DISPLAY MODE (% or count)
=================================================== */
.chart-metric::before {
content: attr(data-percent);
}

[data-submission-summary][data-chart-metric="count"] .chart-metric::before {
content: attr(data-count);
}



/* GROUP CHARTS / ANIMATIONS / PIE CHART
=================================================== */
@media (prefers-reduced-motion: no-preference) {
/* These animations are triggered when switching chart types */
@property --pie-reveal {
syntax: '<angle>';
inherits: false;
initial-value: 0deg;
}

@keyframes pie-chart-reveal {
from { --pie-reveal: 0deg; }
to { --pie-reveal: 360deg; }
}

@keyframes bar-chart-reveal {
from { transform: scaleX(0); }
to { transform: scaleX(1); }
}

.content-card:has([data-submission-summary]) {
[data-ui-card]:has([data-ui-toggle-group-interacted]) {
.pie-chart__disc,
.image-pie-chart__disc {
-webkit-mask-image: conic-gradient(from 0deg, #000 0deg, #000 var(--pie-reveal), transparent var(--pie-reveal));
mask-image: conic-gradient(from 0deg, #000 0deg, #000 var(--pie-reveal), transparent var(--pie-reveal));
--pie-reveal: 0deg;
animation: pie-chart-reveal 0.75s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

.summary-bar-chart__fill {
transform-origin: left center;
}

.summary-bar-chart__fill {
animation: bar-chart-reveal 0.75s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}
}
}
}
1 change: 1 addition & 0 deletions resources/css/cp.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@import './components/notifications.css';
@import './components/page-tree.css';
@import './components/forms.css';
@import './components/forms/charts.css';
@import './components/pagination.css';
@import './components/popover.css';
@import './components/preview.css';
Expand Down
Loading
Loading