@jainprashul/d3-components
TypeScript icon, indicating that this package has built-in type declarations

1.0.34 • Public • Published

d3-components

Contains 3 Components with D3 & React Google Maps

To Install

npm i @jainprashul/d3-components
Note

Please include the google fonts stylesheet to index.html Like this.

    <!-- Google Fonts Icons -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" />

To Use

  • CalibrateMap Component
import { CalibrateMap } from '@jainprashul/d3-components';

const App = () => {
    return (
        <CalibrateMap
          xdim={300} ydim={300}
          apiKey={KEY}
          center={{
            lat: lat,
            lng: lng
          }}

          getMapData={(markers) => {
            console.log(markers)
            setMapData(markers)
          }} />
    )
}
  • Calibrate Floor Plan
import { CalibrateFloor } from '@jainprashul/d3-components';

const App = () => {
    return (
        <CalibrateFloor
          floorPlan={`./floorplan.png`}
          getCalibrationData={(data) => console.log(data)}
          xdim={w} ydim={h} size='medium'
        />
    )
}
  • View Plan
import { ViewPlan } from '@jainprashul/d3-components';

const App = () => {
    return (
    <ViewPlan 
      data={[
        {
          id: 1,
          label: 'A label',
          coordinates: [100, 100],
        },
        {
          id: 2,
          label: 'Another label',
          coordinates: [200, 200],
        },
        {
          id: 3,
          label: 'Yet another label',
          coordinates: [150, 280],
        },
      ]}
      floorPlan='./imgs/template-floor-plan.png'
      marker='./imgs/pointer-green.svg'
      xdim={500}
      ydim={500}
      />
    )
}
  • Google Maps
import { GoogleMaps } from '@jainprashul/d3-components';

const App = () => {
    return (
    <GoogleMaps
      apiKey={KEY}
      center={{
        lat: lat,
        lng: lng
      }}
      markers={markers}
      />
    )
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.340latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.340
1.0.330
1.0.320
1.0.310
1.0.300
1.0.290
1.0.270
1.0.260
1.0.250
1.0.240
1.0.230
1.0.220
1.0.210
1.0.200
1.0.190
1.0.180
1.0.170
1.0.160
1.0.150
1.0.140
1.0.130
1.0.120
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i @jainprashul/d3-components

Weekly Downloads

0

Version

1.0.34

License

ISC

Unpacked Size

497 kB

Total Files

78

Last publish

Collaborators

  • jainprashul