Skip to content
Internals

GoFish

an open-source visualization library for Python and JavaScript

Simple when you want, complex when you need

a bar chart
a streamgraph
a scatterpie
a rose chart
a pulley diagram
simplecomplex

Because graphics are all made of the same stuff

import { Chart, layer, selectAll } from "gofish-graphics";

layer([
  Chart(seafood)
    .flow(
      spread({ by: "lake", dir: "x", spacing: 64 }),
      derive((d) => orderBy(d, "count", "asc")),
      stack({ by: "species", dir: "y" })
    )
    .mark(rect({ h: "count", fill: "species" }).name("bars")),
  Chart(selectAll("bars"))
    .flow(group({ by: "datum.species" }))
    .mark(area({ opacity: 0.8 })),
]).render(el, { w: 400, h: 400, axes: true });
from gofish import chart, Layer, selectAll

Layer([
    chart(seafood)
    .flow(
        spread(by="lake", dir="x", spacing=64),
        derive(lambda d: sorted(d, key=lambda r: r["count"])),
        stack(by="species", dir="y"),
    )
    .mark(rect(h="count", fill="species").name("bars")),
    chart(selectAll("bars"))
    .flow(group(by="datum.species"))
    .mark(area(opacity=0.8)),
]).render(w=400, h=400, axes=True)
made withat