From 7b59c5f51eb70df6114cb4e99033f3409cc9e517 Mon Sep 17 00:00:00 2001 From: Kai Waldrant Date: Mon, 4 Nov 2024 14:00:11 +0100 Subject: [PATCH] remove timeline 1 and 2 --- documentation/fundamentals/timeline.qmd | 132 ---------------------- documentation/fundamentals/timeline_2.qmd | 131 --------------------- 2 files changed, 263 deletions(-) delete mode 100644 documentation/fundamentals/timeline.qmd delete mode 100644 documentation/fundamentals/timeline_2.qmd diff --git a/documentation/fundamentals/timeline.qmd b/documentation/fundamentals/timeline.qmd deleted file mode 100644 index 679e7442..00000000 --- a/documentation/fundamentals/timeline.qmd +++ /dev/null @@ -1,132 +0,0 @@ ---- -title: Timeline variation 1 -execute: - echo: false - output: false -css: "milestones.css" ---- - -```{ojs} -//| output: false - -// Based on https://observablehq.com/@d3/color-legend -function Swatches(color, { - columns = null, - format, - unknown: formatUnknown, - swatchSize = 20, - swatchWidth = swatchSize, - swatchHeight = swatchSize, - marginLeft = "auto" -} = {}) { - const id = `legend-swatches`; - const unknown = formatUnknown == null ? undefined : color.unknown(); - const unknowns = unknown == null || unknown === d3.scaleImplicit ? [] : [unknown]; - const domain = color.domain().concat(unknowns); - if (format === undefined) format = x => x === unknown ? formatUnknown : x; - - function entity(character) { - return `&#${character.charCodeAt(0).toString()};`; - } - - if (columns !== null) return htl.html`
-
${domain.map(value => { - const label = `${format(value)}`; - return htl.html`
-
-
${label}
-
`; - })} -
-
`; - - return htl.html`
-
${domain.map(value => htl.html`${format(value)}`)}
`; -} -``` - -```{ojs} -//| output: true - -Swatches(d3.scaleOrdinal(["event", "milestone", "competition", "benchmark"], ["#d95f02", "#1b9e77", "#e7298a", "#FF414B"])) -``` -:::{#timeline} -::: - - -```{ojs requires} -//| output: false - -require('d3'); -ms = require('d3-milestones'); -sb = require('@supabase/supabase-js'); -``` - - - -```{ojs supabase_data} -//| output: false - -supabase_url="https://bleficzaoyltozjjndha.supabase.co" -supabase_key="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJsZWZpY3phb3lsdG96ampuZGhhIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjQyNDI2ODMsImV4cCI6MjAzOTgxODY4M30.fHtpJTveDUF1z07_k7FZX3wLy7bXpkYl5KyA5o_EuQY" -supabase = sb.createClient(supabase_url, supabase_key); - -benchmarks = (await supabase - .from('tasks') - .select('first_release, name, task_name')) - .data - .filter(item => item.first_release !== null) - .map(item => ({ - date: item.first_release, - name: item.name, - task_name: item.task_name.replace(/^task_/, ''), - type: "benchmark", - url: '../results/' + item.task_name.replace(/^task_/, ''), - category: "benchmark" - })); - -// Add result link - -timeline = (await supabase - .from('timeline') - .select('name, date, type')) - .data - .map(item => ({ - name: item.name, - date: item.date, - type: item.type, - category: "timeline", - textStyle: { - color: item.type === 'event' ? '#d95f02' : - item.type === 'milestone' ? '#1b9e77' : - item.type === 'competition' ? '#e7298a' : 'default' - } - })); - - -combinedData = benchmarks.concat(timeline); - -``` - - -```{ojs timeline} -//| output: false - -setTimeout(() => { - const benchmarkChart = ms('#timeline') - .mapping({ - 'timestamp': 'date', - 'text': 'name', - }) - .optimize(true) - .parseTime('%Y-%m-%d') - .aggregateBy('month') - .orientation('horizontal') - .render(combinedData); -}, 0); - -``` - - - - \ No newline at end of file diff --git a/documentation/fundamentals/timeline_2.qmd b/documentation/fundamentals/timeline_2.qmd deleted file mode 100644 index 74bac280..00000000 --- a/documentation/fundamentals/timeline_2.qmd +++ /dev/null @@ -1,131 +0,0 @@ ---- -title: Timeline variation 2 -execute: - echo: false - output: false -css: "milestones.css" ---- - -```{ojs} -//| output: false - -// Based on https://observablehq.com/@d3/color-legend -function Swatches(color, { - columns = null, - format, - unknown: formatUnknown, - swatchSize = 20, - swatchWidth = swatchSize, - swatchHeight = swatchSize, - marginLeft = "auto" -} = {}) { - const id = `legend-swatches`; - const unknown = formatUnknown == null ? undefined : color.unknown(); - const unknowns = unknown == null || unknown === d3.scaleImplicit ? [] : [unknown]; - const domain = color.domain().concat(unknowns); - if (format === undefined) format = x => x === unknown ? formatUnknown : x; - - function entity(character) { - return `&#${character.charCodeAt(0).toString()};`; - } - - if (columns !== null) return htl.html`
-
${domain.map(value => { - const label = `${format(value)}`; - return htl.html`
-
-
${label}
-
`; - })} -
-
`; - - return htl.html`
-
${domain.map(value => htl.html`${format(value)}`)}
`; -} -``` - -```{ojs} -//| output: true -Swatches(d3.scaleOrdinal(["event", "milestone", "competition", "benchmark"], ["#d95f02", "#1b9e77", "#e7298a", "#FF414B"])) -``` -:::{#timeline} -::: - - -```{ojs requires} -//| output: false - -require('d3'); -ms = require('d3-milestones'); -sb = require('@supabase/supabase-js'); -``` - - - -```{ojs supabase_data} -//| output: false - -supabase_url="https://bleficzaoyltozjjndha.supabase.co" -supabase_key="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJsZWZpY3phb3lsdG96ampuZGhhIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjQyNDI2ODMsImV4cCI6MjAzOTgxODY4M30.fHtpJTveDUF1z07_k7FZX3wLy7bXpkYl5KyA5o_EuQY" -supabase = sb.createClient(supabase_url, supabase_key); - -benchmarks = (await supabase - .from('tasks') - .select('first_release, name, task_name')) - .data - .filter(item => item.first_release !== null) - .map(item => ({ - date: item.first_release, - name: item.name, - task_name: item.task_name.replace(/^task_/, ''), - type: "benchmark", - url: '../results/' + item.task_name.replace(/^task_/, ''), - category: "benchmark" - })); - -// Add result link - -timeline = (await supabase - .from('timeline') - .select('name, date, type')) - .data - .map(item => ({ - name: item.name, - date: item.date, - type: item.type, - category: "timeline", - textStyle: { - color: item.type === 'event' ? '#d95f02' : - item.type === 'milestone' ? '#1b9e77' : - item.type === 'competition' ? '#e7298a' : 'default' - } - })); - - -combinedData = benchmarks.concat(timeline); - -``` - - -```{ojs timeline} -//| output: false - -setTimeout(() => { - const benchmarkChart = ms('#timeline') - .mapping({ - 'timestamp': 'date', - 'text': 'name', - }) - .optimize(true) - .parseTime('%Y-%m-%d') - .aggregateBy('day') - .orientation('vertical') - .render(combinedData); -}, 0); - -``` - - - - \ No newline at end of file