From 8f06e5026ebe4c531ca200ab8b5075fb1401a015 Mon Sep 17 00:00:00 2001 From: VSe Date: Fri, 19 Apr 2024 12:14:53 +0200 Subject: [PATCH] table filtered, simple slider done --- docs/data-preview.qmd | 51 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/docs/data-preview.qmd b/docs/data-preview.qmd index 1e7b275..35ac7bc 100644 --- a/docs/data-preview.qmd +++ b/docs/data-preview.qmd @@ -4,6 +4,7 @@ author: "Jeremiah Lewis" format: html: code-fold: false +echo: false --- # Data Preview @@ -19,15 +20,57 @@ Furthermore, at the moment the data is provided without any license terms, so pl ## Dataset -Raw (beta) data available for inspection [here](https://trr266.github.io/quarto-template-data-website/sample_data.csv). +Raw (beta) data available for inspection [here](https://trr266.github.io/quarto-template-data-website-2/template_pr_quarto_final_180424.csv). + ```{ojs} -//| echo: false -profit_data = FileAttachment("template_pr_quarto_final_180424.csv").csv({ typed: true }) +import { interval } from '@mootari/range-slider' + +viewof YearSlider = interval([2015, 2021], { + step: 1, + value: [2015, 2021], + label: 'Please select year range', +}); + +``` -Inputs.table(profit_data) + + + + + + + + + + + +```{ojs} +//Inputs.table(filtered, {sort: "isin_random", reverse: true, width: {concept: 140}}) + +Inputs.table(filtered, {sort: [{column: "isin_random", direction: "desc"}, {column: "year", direction: "desc"}], width: {concept: 140}}) ``` +```{ojs} +data = FileAttachment("template_pr_quarto_final_180424.csv").csv({ typed: true }) +``` + + +```{ojs} +filtered = data.filter(function(row) { + return YearSlider[0] <= row.year && YearSlider[1] >= row.year; + //islands.includes(penguin.island); +}) +``` + + + + + + + + + ## Visualization