Skip to content

Instantly share code, notes, and snippets.

@vnegi10
Created May 10, 2024 10:12
Show Gist options
  • Save vnegi10/5cc6144e6659a98627637cf921d09369 to your computer and use it in GitHub Desktop.
Save vnegi10/5cc6144e6659a98627637cf921d09369 to your computer and use it in GitHub Desktop.
theme toc
dashboard
false

Total value

import {plotValue, plotBreakdownBar, plotBreakdownArea} from "./components/plots.js";
import {createStack, getPertChange} from "./components/helpers.js";
const breakdown = FileAttachment("./data/value.json").json();
 
   

Last 7 days change [%]

    ${getPertChange(breakdown, 7)}  
 
   

Last 30 days change [%]

    ${getPertChange(breakdown, 30)}  
   
${resize((width) => plotValue(breakdown, {width}))}

Breakdown

   
${resize((width) => plotBreakdownBar(createStack(breakdown), {width}))}
   
${resize((width) => plotBreakdownArea(createStack(breakdown), {width}))}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment