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 🙏

© 2025 – Pkg Stats / Ryan Hefner

synapsefi-dev-charts

v1.2.5

Published

charting ui components

Downloads

16

Readme

import { ChartSelector, ChartWithFilter } from 'synapsefi-dev-charts';


<ChartSelector
    title="Deposit Activity" // Title of Chart
    keys={[
      "Balance", 
      "Count"  // Turns into buttons, does not have to have to match yAxis prop on <ChartWithFilter>, but index has to match.
    ]}
>
    <ChartWithFilter 
        report={reportForThisChart}
        yAxis="Balance"
    />
    <ChartWithFilter 
        report={reportForThisChart}
        yAxis="Count"
    />
</ChartSelector>

Report props format:

  • Each object in report array is one line.
  • Each object in "data" array is one point on the line.
[
  {
    "id": "SYNAPSE-US",
    "color": "#FF8A00",
    "data": [
      {
        "x": "03/01/2020",
        "y": 58575241.58
      },
      {
        "x": "03/02/2020",
        "y": 58574978.64
      },
    ]
  },
  {
    "id": "CUSTODY-US",
    "color": "#008759",
    "data": [
      {
        "x": "03/01/2020",
        "y": 0
      },
      {
        "x": "03/02/2020",
        "y": 0
      },
    ]
  },
]

Demo with props labeled

Markers

<ChartWithFilter 
  report={RDCReportReport}
  yAxis="Percent"
  markers={[
    {
      value: 10,
      legend: 'All Returns Threshold', // the line of text on the dotted line
      id: 'All Returns', // marker id must match the line's id for the line to show
    },
    {
      value: 2,
      legend: 'Admin Returns Threshold',
      id: 'Admin Returns',
    },
    {
      value: 0.5,
      legend: 'Unauth Returns Threshold',
      id: 'Unauth Returns',
    },
  ]}
/>

Functions

/**
 * transforms raw report from the api into report used by chart
 * @param {array} reportRaw the raw report from api
 * @param {string} key the first key in the report object, 'ach_report', 'balances' etc
 * @param {string} subKey optional, the final key in the object, such as 'count', 'balance', etc
 */
reportParser(reportRaw, key, subKey)

const reportRaw = [
  {
    "_id": {
      "$oid": "5e5b6e7d6973745715ba49fe"
    },
    "_v": 1,
    "ach_report": { // key
      "admin_returns": 0, // no subKey needed
      "admin_returns_amount": 0,
      "ml_returned_count": 0,
      "ml_returned_sum": 0,
      "returned_count": 6,
      "returned_sum": 600.6,
      "settled_count": 23,
      "settled_sum": 210.64,
      "unauth_returns": 0,
      "unauth_returns_amount": 0
    },
    "balances": { // key
      "CLEARING-US": {
        "balance": 0,  // subKey
        "count": 7,
        "pending": 0
      },
      "CUSTODY-US": {
        "balance": 0,
        "count": 2,
        "pending": 0
      }
    },
    ...
  }
]

/**
 * remove all lines that are entirely zero, null, or undefined
 * @param {array} parsedData the output of reportParser function
 */
removeDataOfZero(parsedData)


/**
 * snake car to capitalized case, accounts for acronyms and caps all letters
 * @param {array} string admin_return -> Admin Return
 */
snakeToCap(string)

Default Graphics

<DefaultGraphics
  mainText="No Range and Client Selected" // optional
  subText="Please Select" // optional
  graphic="calendar" // optional
/>

Customize the order and appearance of keys

<ChartWithFilter 
  report={reportForThisChart}
  yAxis="Balance"
  keyOrder={
    [
      { key: "CUSTODY-US", text: 'custoday test'},
      { key: "SYNAPSE-US", text: 'synapsef us test'},
    ]
  }
/>