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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wimmics/venus

v1.0.1

Published

Web Components for SPARQL/D3 visualizations

Readme

@wimmics/venus

VENUS is a JavaScript library for creating interactive visualizations and dashboards from SPARQL queries.

The @wimmics/venus package provides five web components for different visualization techniques. Each component accepts either a SPARQL query or a SPARQL JSON result set, together with a declarative JSON encoding specification. The component retrieves the data, transforms it into visualization-specific structures, and renders the output as interactive SVG visualizations.

Visualization Types

| Component | Purpose | Use Case | |-----------|---------|----------| | <venus-graph> | Force-directed node-link diagram | Entity relationships, co-occurrence networks | | <venus-barchart> | Grouped/stacked bar chart | Categorical comparisons, multi-series data | | <venus-linechart> | Multi-series line chart | Time series, trends, continuous data | | <venus-scatterplot> | 2D point scatter plot | Correlation analysis, bivariate distributions | | <venus-sankey> | Flow/Sankey diagram | Flow visualization, hierarchical transitions |

Installation

npm install @wimmics/venus

Quick Start

Add a Component to HTML

<venus-graph id="graph" width="100%" height="600px"></venus-graph>

Configure and Launch (Property API)

const graph = document.querySelector("#graph");

graph.sparqlEndpoint = "https://dbpedia.org/sparql";
graph.sparqlQuery = "SELECT ?source ?target WHERE { ?source dbo:starring ?target } LIMIT 30";

graph.encoding = {
  nodes: { 
    color: { value: "#666" },
    label: { field: "source" }
  },
  links: { color: { value: "#999" } },
  interactions: { drag: true, zoom: true }
};

await graph.launch();

Attribute API (HTML)

Alternatively, configure using HTML attributes with JSON strings:

<venus-graph
  sparqlEndpoint="https://dbpedia.org/sparql"
  sparqlQuery='SELECT ?category ?value { ... }'
  encoding='{"bars": {"x": {"field": "category"}, "y": {"field": "value"}}}'
  width="800"
  height="600"
></venus-graph>

<script>
  document.querySelector("venus-graph").launch();
</script>

Using Pre-Computed Results

const graph = document.querySelector("#graph");

graph.sparqlResult = {
  head: { vars: ['source', 'target', 'weight'] },
  results: { bindings: [ ... ] }
};

graph.encoding = { ... };
await graph.launch();

Encoding Specifications

Each visualization type has its own encoding schema for mapping data to visual properties:

// Bar chart example
graph.encoding = {
  bars: {
    x: { field: 'category' },
    y: { field: 'value' },
    color: { field: 'region', scale: { type: 'ordinal', range: 'Set2' } }
  },
  interactions: { tooltip: true }
};

// Graph example
graph.encoding = {
  nodes: { 
    color: { field: 'type', scale: { type: 'ordinal', range: 'Set3' } },
    size: { field: 'degree', scale: { type: 'sqrt', range: [5, 30] } }
  },
  links: { color: { value: '#999' } },
  interactions: { drag: true, zoom: true, tooltip: true }
};

See @wimmics/venus-encoding for complete encoding specifications.

API Reference

Properties

  • sparqlEndpoint (string): SPARQL endpoint URL for query execution
  • sparqlQuery (string): SPARQL SELECT query to fetch data
  • sparqlResult (object): Pre-computed SPARQL JSON result (alternative to endpoint + query)
  • encoding (object): Visual encoding specification (defines how data maps to visuals)
  • proxy (string): Optional CORS proxy URL for endpoints that don't support CORS
  • width (number|string): Component width (e.g., 800, "100%")
  • height (number|string): Component height (e.g., 600, "100%")
  • resize (boolean): Enable responsive resizing on window resize (default: true)

Methods

  • launch(): Fetches data and renders the visualization (async)
  • setEncoding(spec): Updates visual encoding and re-renders
  • getEncoding(): Returns the current merged encoding with defaults applied

Documentation

Related Packages

This package is the web component layer. For lower-level APIs:

License

See LICENSE in the repository root.