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

@impetusuxp/vizualy-horizontal-bullet-chart

v1.0.2

Published

Horizontal Bullet chart of Vizualy library by Impetus Technologies

Readme

Horizontal Bullet Chart

Installation

Use the package manager NPM to install Horizontal Bullet Chart.

npm install @impetusuxp/vizualy-horizontal-bullet-chart

Sample Data (Chart's required data format)

const data = [
    {
        "sales": 52,
        "marketing": 110,
        "hr": 250,
        "salesperson": "A salesperson"
    },
    {
        "sales": 600,
        "marketing": 1200,
        "salesperson": "B salesperson"
    },
    {
        "sales": 850,
        "marketing": 300,
        "salesperson": "C salesperson"
    },
    {
        "sales": 3052,
        "marketing": 2300,
        "salesperson": "D salesperson"
    },
    {
        "sales": 55,
        "marketing": 200,
        "salesperson": "E salesperson"
    },
    {
        "sales": 100,
        "marketing": 242,
        "salesperson": "F salesperson"
    },
    {
        "sales": 12,
        "marketing": 140,
        "salesperson": "G salesperson"
    }
];

Usage

import HorizontalBulletChart from '@impetusuxp/vizualy-horizontal-bullet-chart';

const horizontalBulletChart = new HorizontalBulletChart();

// Draw chart
horizontalBulletChart
      .container('containerID')
      .x('x axis key in data') // Referred as "sales, hr, marketing" in sample data
      .y('y axis key in data') // Referred as "salesperson" in sample data
      .data(data object) // Referred to sample data
      .settings(chart configuration object)
      .draw();

// Update chart
horizontalBulletChart.data(updated data object).update();
<script type="text/javascript" src="./libs/d3.v6.min.js"></script>
<script type="text/javascript" src="./vizualy-assistant/src/js/utility.js"></script>
<script type="text/javascript" src="./vizualy-assistant/src/js/assistant.js"></script>
<script type="text/javascript" src="./vizualy-assistant/src/js/observer.js"></script>
<script type="text/javascript" src="./vizualy-horizontal-bullet-chart/vizualy-horizontal-bullet-chart.js"></script>
<script>
const horizontalBulletChart = new vizualy.HorizontalBulletChart();

// Draw chart
horizontalBulletChart
      .container('containerID')
      .x('x axis key in data') // Referred as "sales, hr, marketing" in sample data
      .y('y axis key in data') // Referred as "salesperson" in sample data
      .data(data object) // Referred to sample data
      .settings(chart configuration object)
      .draw();

// Update chart
horizontalBulletChart.data(updated data object).update();
</script>
Make sure to use/import vizualy-assistant/src/css/common.css in your code-base as per recommended by frontend framework being used

Configurations/Settings

dimension: {
    width: 500,
    height: 500,
    margin: { top: 20, right: 20, bottom: 40, left: 40 }
}

Key | Type | Default | Description ----|-------- | -------|------ width | Number in px | Default width of container | To provide custom width to chart. height| Number in px | Default height of container | To provide custom height to chart. margin| Object | { top: 20, right: 20, bottom: 40, left: 40 } | To provide margin to chart.

xAxis: {
    isVisible: true,
    isGridsVisible: true,
    tickFormat: (d) => d
}

Key | Type | Default | Description ----|-------- | -------|------ isVisible| Boolean | True | To show/hide X axis isGridsVisible| Boolean | True | To show/hide X axis grids tickFormat | Function | Default ticks | To customize ticks labels available via argument(d).

yAxis: {
    isVisible: true,
    isGridsVisible: true,
    tickFormat: (d) => d
}

Key | Type | Default | Description ----|-------- | -------|------ isVisible| Boolean | True | To show/hide Y axis. isGridsVisible| Boolean | True | To show/hide Y axis grids. tickFormat | Function | Default ticks | To customize ticks labels available via argument(d).

xAxisLabel: {
    value: '',
    margin: 40,
    isVisible: true
}

Key | Type | Default | Description ----|-------- | -------|------ isVisible| Boolean | True | To show/hide X axis label. margin| Number | 40 | To provide top margin from X axis line. value| String(any) | 'X-axis' | To provide custom X axis label.

yAxisLabel: {
    value: '',
    margin: 50,
    isVisible: true
}

Key | Type | Default | Description ----|-------- | -------|------ isVisible| Boolean | True | To show/hide Y axis label. margin| Number | 50 | To provide right margin from Y axis line. value| String(any) | 'Y-axis' | To provide custom Y axis label.

barLabel: {
        isVisible: true,
        labelFormat: (d) => d
}

Key | Type | Default | Description ----|-------- | -------|------ isVisible| Boolean | True | To show/hide barLabel labelFormat| Function | Default ticks | To customize ticks labels available via arguement(d).

barSpace : {
    type: 'perc',
    value: 0.1 
},

Key | Type | Default | Description ----|-------- | -------|------ type| String | 'perc' | Set bar space type to keep the bar separated at certain space value | Number | 0 | Set bar space value

brush: {
        isVisible: false,
        limit: 30,
        offset: 0,
        height: 80,
        margin: 60
}

Key | Type | Default | Description ----|-------- | -------|------ isVisible| Boolean | false | To keep the legend in active/hidden state. limit | Number | 30 | To set limit to the brush. offset| Number | 0 | Add offset to brush. height| Number | 80 | To provide height of brush. margin| Number | 60 | To provide margin around brush.

tooltip: {
    isVisible: true,
    content: (d, chartObject) => "Some html",
    placement: "top-right"
}

Key | Type | Default | Description ----|-------- | -------|------ isVisible| Boolean | True | To keep the tooltip in active/hidden state content| Function | Chart specific HTML | To provide custom tooltip content placement| String(top-right, top-left, bottom-right, bottom-left, auto) | 'top-right' | To provide static direction to tooltip wrapper.

animation: {
    isApplied: true,
    duration: 750,
    type: 'cubic'
}

Key | Type | Default | Description ----|-------- | -------|------ isApplied| Boolean | True | To activate/deactivate animations duration| Number(in ms) | 750 | duration of animation type| String("elastic", "bounce", "linear", "sin", "quad", "cubic", "poly", "circle", "exp", "back") | 'cubic' | type of animation.

legend: {
          isVisible: true,
          placement: 'right',
          margin: { top: 10, right: 10, bottom: 10, left: 10 },
          rectWidth: 10,
          rectHeight: 10,
          textKey: null,
          textFormat: (d) => d,
}

Key | Type | Default | Description ----|-------- | -------|------ isVisible| Boolean | True | To keep the legend in active/hidden state. placement| String(right, left, bottom, top) | 'right' | To give position to legend margin| Object | { top: 10, right: 10, bottom: 10, left: 10 } | To give margin around Legend rectWidth| Number | 10 | Width of legend rectangle. rectHeight| Number | 10 | Height of legend rectangle. textkey| Object | null | Property key in data as legend text. textFormat| Function | Default ticks | To customize legend text available via argument(d).

showLabel: {
        isVisible: false,
        key: "",
        format: (d) => {}
}

Key | Type | Default | Description ----|-------- | -------|------ isVisible | Boolean | False | To show/hide showLabel. key | String | '' | To provide key to showLabel. format | Function | |To customize labels available via argument(d).

xScaleType: {
        type: "time"
    }

Key | Type | Default | Description ----|-------- | -------|------ type| Boolean | True | Set the X scale type such as band, linear etc.

yScaleType: {
        type: "linear"
    }

Key | Type | Default | Description ----|-------- | -------|------ type| Boolean | True | Set the Y scale type such as linear etc.

xAxisTicksCount: {
    isApplied: false,
    value: ''
}

Key | Type | Default | Description ----|-------- | -------|------ isApplied| Boolean | False | To activate/deactivate Axis tick Count. value | Number | 0 | Set x axis tick count

xWordWrap: {
    isVisible: false,
    linesToAddEllipses: 1
},

Key | Type | Default | Description ----|-------- | -------|------ isVisible| Boolean | false | To show/hide line label. linesToAddEllipses | Number | 1 | To apply ellipses (...) and wrap the text

yWordWrap: {
    isVisible: false,
    linesToAddEllipses: 1
},

Key | Type | Default | Description ----|-------- | -------|------ isVisible| Boolean | false | To show/hide line label. linesToAddEllipses | Number | 1 | To apply ellipses (...) and wrap the text.

rotateYAxisTick: {
    isVisible: false,
    value: [-10, 10, 10]
}

Key | Type | Default | Description ----|-------- | -------|------ isVisible| Boolean | False | To show/hide Y Axis tick. value | Array | [-10, 10, 10] | To rotate Y-Axis ticks, Values represent as [relative Y position of ticks label, relative x position, rotation-angle].

rotateXAxisTick: {
    isVisible: false,
    value: [-10, 10, 10]
}

Key | Type | Default | Description ----|-------- | -------|------ isVisible| Boolean | False | To show/hide X Axis tick. value | Array | [-10, 10, 10] | To rotate X-Axis ticks, Values represent as [relative X position of ticks label, relative y position, rotation-angle].

isResponsive: true

Key | Type | Default | Description ----|-------- | -------|------ isResponsive| Boolean | True | To activate/deactivate responsive behavior of chart.

emptyDataMessage: 'No Data Available'

Key | Type | Default | Description ----|-------- | -------|------ emptyDataMessage| String | 'No Data Available'| To customize message to be displayed on screen when data is empty.

exceptionMessage: 'Something went wrong!! Please see logs.'

Key | Type | Default | Description ----|-------- | -------|------ exceptionMessage| String | 'Something went wrong!! Please see logs.'| To customize message to be displayed on screen when any error occurs.

Chart's life cycle hooks:-

chartObject.on('beforeDraw', () => { // do something })
chartObject.on('completeDraw', () => { // do something })
chartObject.on('beforeUpdate', () => { // do something })
chartObject.on('completeUpdate, () => { // do something })
chartObject.on('beforeResize', () => { // do something })
chartObject.on('completeResize', () => { // do something })

Key | Type | Default | Description ----|-------- | -------|------ on| Function('eventId', handler) | No action | To perform custom actions on mentioned events.

Event subscription

horizontalBulletChart.getElement("bar").on('mouseMove', [(d, element, event) => { }], removePreviousHandlers: boolean);

We can attaché multiple handlers(Array of functions) on events(mouseMove) to exposed element(bar). We have below events to subscribe -> mouseMove, mouseEnter, mouseOut, mouseOver, click

Contriubutor

Impetus Technologies

License

MIT