Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vega-typings

Package Overview
Dependencies
Maintainers
6
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-typings

Typings for Vega.

  • 1.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created

What is vega-typings?

The vega-typings npm package provides TypeScript type definitions for Vega, a visualization grammar that allows for the creation, sharing, and exploration of a wide variety of data visualizations. These typings help developers ensure type safety and better development experience when working with Vega specifications in TypeScript.

What are vega-typings's main functionalities?

Vega Specification Typings

This feature provides type definitions for creating Vega specifications. The code sample demonstrates a simple bar chart specification using Vega.

{
  "$schema": "https://vega.github.io/schema/vega/v5.json",
  "width": 400,
  "height": 200,
  "data": [
    {
      "name": "table",
      "values": [
        {"category": "A", "amount": 28},
        {"category": "B", "amount": 55},
        {"category": "C", "amount": 43}
      ]
    }
  ],
  "marks": [
    {
      "type": "rect",
      "from": {"data": "table"},
      "encode": {
        "enter": {
          "x": {"scale": "xscale", "field": "category"},
          "y": {"scale": "yscale", "field": "amount"},
          "width": {"scale": "xscale", "band": 1},
          "height": {"scale": "yscale", "band": 1}
        }
      }
    }
  ]
}

Signal Typings

This feature provides type definitions for signals in Vega. Signals are dynamic variables that can drive interactive behaviors. The code sample shows how to define a signal that updates on mouseover and mouseout events.

{
  "signals": [
    {
      "name": "hover",
      "value": {},
      "on": [
        {"events": "rect:mouseover", "update": "datum"},
        {"events": "rect:mouseout", "update": "{}"}
      ]
    }
  ]
}

Data Transform Typings

This feature provides type definitions for data transformations in Vega. The code sample demonstrates a simple filter transformation that filters out data points where the amount is less than or equal to 30.

{
  "data": [
    {
      "name": "table",
      "values": [
        {"category": "A", "amount": 28},
        {"category": "B", "amount": 55},
        {"category": "C", "amount": 43}
      ],
      "transform": [
        {
          "type": "filter",
          "expr": "datum.amount > 30"
        }
      ]
    }
  ]
}

Other packages similar to vega-typings

Keywords

FAQs

Package last updated on 14 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc