diff --git a/ts/graphs/EaseGraph.svelte b/ts/graphs/EaseGraph.svelte index 76725fb6e..89c728b44 100644 --- a/ts/graphs/EaseGraph.svelte +++ b/ts/graphs/EaseGraph.svelte @@ -26,7 +26,7 @@
{subtitle}
- + diff --git a/ts/graphs/ease.ts b/ts/graphs/ease.ts index 872efa77d..05d3212fb 100644 --- a/ts/graphs/ease.ts +++ b/ts/graphs/ease.ts @@ -61,6 +61,21 @@ export function prepareData( }); } + function makeQuery(data: HistogramData, binIdx: number): string { + const bin = data.bins[binIdx]; + const start = bin.x0!; + const end = (bin.x1! - 1); + + if (start === end) { + return `"prop:ease=${start / 100}"`; + } + + const fromQuery = `"prop:ease>=${start / 100}"`; + const tillQuery = `"prop:ease<${end / 100}"`; + + return `${fromQuery} AND ${tillQuery}`; + } + const xTickFormat = (num: number): string => `${num.toFixed(0)}%`; const tableData = [ { @@ -70,7 +85,7 @@ export function prepareData( ]; return [ - { scale, bins, total, hoverText, colourScale, showArea: false, xTickFormat }, + { scale, bins, total, hoverText, makeQuery, colourScale, showArea: false, xTickFormat }, tableData, ]; }