Skip to content

Latest commit

 

History

History
56 lines (38 loc) · 1.2 KB

README.md

File metadata and controls

56 lines (38 loc) · 1.2 KB

@gramex/chartbase

Base utilities for charts

Example

import { layer, getSVG } from "https://cdn.jsdelivr.net/npm/@gramex/chartbase@1";
// Create a new g.layer under <svg id="chart-svg"> ONLY IF it does not exist
layer(d3.select("svg#chart-svg"), "g", "layer");
// Get the viewBox width and height of <svg id="chart-svg">
const { width, height } = getSVG("svg#chart-svg");

Installation

Install via npm:

npm install @gramex/chartbase

Use locally as an ES module:

<script type="module">
  import chartbase from "./node_modules/@gramex/chartbase/dist/chartbase.js";
</script>

Use via CDN as an ES Module:

<script type="module">
  import chartbase from "https://cdn.jsdelivr.net/npm/@gramex/chartbase@1";
</script>

API

See API documentation

Release notes

  • 1.0.4: 28 Oct 2024. Deploy at gramex-chartbase.straive.app ensure https://cdn.jsdelivr.net/npm/@gramex/chartbase@1 works
  • 1.0.3: 18 Aug 2024. Security update
  • 1.0.2: 24 Nov 2023. Fix getSVG() width and height calculation
  • 1.0.0: 31 Oct 2023. Initial release

Authors

Anand S s.anand@gramener.com

License

MIT