amirlogic / json-to-svg

Generate SVG from JSON using D3.js

Home Page:https://nestedlogic.vercel.app/json-to-svg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JSON to SVG

Generates SVG from JSON

Installation: 'npm i json-to-svg'

import svgen from 'json-to-svg';

import * as d3 from "d3";

console.log( 
    
    svgen(d3,{"target":"histogram","color":"blue","barwidth":20,"intergap":5,"dataset":[25,67,45,19,89],"size":2,"animate":false}) 
    
)

HTTP server

import svgen from 'json-to-svg'

import * as d3 from "d3";

import { webpage, getHtml } from 'htwrite'

import http from 'http'

let xml = svgen(d3,{"target":"histogram","color":"blue","barwidth":20,"intergap":5,"dataset":[25,67,45,19,89],"size":2,"animate":false}) 

http.createServer(function (req, res) {
    res.write(webpage("demo",'',xml));
    res.end();
  }).listen(8080);

console.log(`server started at http://localhost:8080`)

About

Generate SVG from JSON using D3.js

https://nestedlogic.vercel.app/json-to-svg


Languages

Language:JavaScript 100.0%