npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@memotux/vue-plot

v0.4.1-beta.1

Published

Vue.js UI Components for visualizing tabular data using [`@observablehq/plot` library](https://github.com/observablehq/plot).

Downloads

3

Readme

Vue Plot

Vue.js UI Components for visualizing tabular data using @observablehq/plot library.

[!CAUTION] Beta release

Usage

Install @memotux/vue-plot package:

[!IMPORTANT] Package is in Beta release

pnpm add @memotux/vue-plot @observablehq/plot

Add plotCustomElement to vite.config.plugins.vue to register PlotMarks as Vue Custom Component.

import { plotCustomElement } from '@memotux/vue-plot'

export default defineConfig({
  // ...
  plugins: [
    vue({
      ...plotCustomElement,
    }),
  ],
  // ...
})

Plugin

Import plugin install function VuePlot and use it on your Vue.app:

import { createApp } from 'vue'
import { VuePlot } from '@memotux/vue-plot'

const app = createApp({})

// ...

app.use(VuePlot)

// ...

This will install VPlot component globally on your App.

Component Local Registration

Also you can use VPlot component in local registration:

<script setup>
import { VPlot } from '@memotux/vue-plot'

defineProps(['options', 'marks'])
</script>

<template>
  <VPlot
    v-bind="options"
    :marks="marks"
  />
</template>

Using VPlot

<script setup>
import { reactive, computed } from 'vue'
import { VPlot } from '@memotux/vue-plot'
import { frame, text } from '@observablehq/plot'

const hello = reactive(['Hello World!'])
const helloOptions = reactive({
  frameAnchor: 'middle',
})

const plot = computed(() => ({
  width: 688,
  className: 'plot',
  marks: [frame(), text(hello, helloOptions)],
}))
</script>

<template>
  <!-- Plot Marks in props -->
  <VPlot v-bind="plot" />
  <!-- Plot Marks as children -->
  <VPlot v-bind="{ ...plot, marks: undefined }">
    <PlotFrame />
    <PlotText v-bind="{ ...helloOptions, data: hello }" />
  </VPlot>
</template>
interface PlotProps extends PlotOptions {}

// PlotMarksOptions are different for each mark
interface PlotMarkProps extends MarksOptions {
  data?: Plot.Data
}

Marks

Plot Marks must be present as props or as children.

Marks as props must be imported from @observablehq/plot and passed as marks property to VPlot component.

Marks as children are defined as any other Vue.js Component, wich name must start with Plot followed by Mark name.

<template>
  <VPlot>
    <PlotArea />
    <PlotBarY />
  </VPlot>
</template>

This Custom Components recive as props same mark arguments types. Example:

<script lang="js">
//                      data    Mark options
const mark = Plot.areaY(aapl, {x: "Date", y: "Close"})
</script>
<!-- equivalent to -->
<template>
  <PlotAreaY
    :data="aapl"
    x="Date"
    y="Close"
  />
</template>

Note how data and options are equivalent from parameters to props.

<script setup lang="ts">
import { VPlot } from '@memotux/vue-plot'
import { aapl } from 'data'
import type { PlotOptions, AreaYOptions } from '@observablehq/plot'

// This are global plot options
const plotOptions: PlotOptions = {
  width: 688,
  className: 'plot',
}

// This are specific mark options
const options: AreaYOptions = {
  x: 'Date',
  y: 'Close',
}
</script>

<template>
  <Plot
    :width="688"
    className="plot"
  >
    <PlotAreaY
      :data="aapl"
      x="Date"
      y="Close"
    />
  </Plot>
</template>

If you define marks as props AND as children, only marks as children will be rendered.

Credits

This project was inspired by: