Skip to content

Commit

Permalink
generate arrow structure on the fly rather than using a file
Browse files Browse the repository at this point in the history
  • Loading branch information
Fil committed Sep 9, 2024
1 parent db20949 commit 882ed4a
Show file tree
Hide file tree
Showing 3 changed files with 177 additions and 2 deletions.
Binary file removed test/data/height_frequency.arrow
Binary file not shown.
173 changes: 173 additions & 0 deletions test/output/bigintNormalize.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions test/plots/bigint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ export async function bigintStack() {
}

export async function bigintNormalize() {
const table = await Arrow.tableFromIPC(fetch("data/height_frequency.arrow"));
const heights = await d3.csv("data/athletes.csv").then((data) => data.map((d) => d.height));
const table = Arrow.tableFromJSON(
d3.groups(heights, (d) => (d ? +d : NaN)).map(([height, {length}]) => ({height, frequency: BigInt(length)}))
);
return Plot.plot({
height: 500,
x: {percent: true, grid: true},
y: {domain: [1.3, 2.21]},
marks: [
Plot.ruleX([0]),
Plot.ruleY(
Expand Down

0 comments on commit 882ed4a

Please sign in to comment.