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

@streamlinedfi/charts

v0.1.8

Published

Charting Library with Financial Candlesticks Chart that provides an alternative to TradingView

Readme

Streamlined Charts

Charting Library with Financial Candlesticks Chart that provides an alternative to TradingView

Screenshot of Streamlined Charts

Attribution Note

This chart is the one used by Streamlined Finance. It is free to use, provided that attribution is maintained by keeping the logo visible in the chart.

If you encounter any issues or have suggestions, please open an issue in the repository.

Installation

# with Yarn
$ yarn add @streamlinedfi/charts styled-components

# with npm
$ npm i @streamlinedfi/charts styled-components

# with pnpm
$ pnpm add @streamlinedfi/charts styled-components

# with Bun
$ bun add @streamlinedfi/charts styled-components

Basic Setup

CandlesCharts works like a controlled component, where you provide the config and the data.

import { CandlesChart } from '@streamlinedfi/charts';

const defaultRequestBars = 100;

const TimeFrames = {
  M1: 'M1',
  M3: 'M3',
  M5: 'M5',
  M10: 'M10',
  M15: 'M15',
  M20: 'M20',
  M30: 'M30',
  H1: 'H1',
  H2: 'H2',
  H4: 'H4',
  D1: 'D1',
  W1: 'W1',
};

// timeframes need a text and id property
const timeframes = {
  [TimeFrames.M15]: {
    text: '15m',
    id: TimeFrames.M15,
  },
  [TimeFrames.M30]: {
    text: '30m',
    id: TimeFrames.M30,
  },
  [TimeFrames.H1]: {
    text: '1h',
    id: TimeFrames.H1,
  },
  [TimeFrames.H4]: {
    text: '4h',
    id: TimeFrames.H4,
  },
  [TimeFrames.D1]: {
    text: 'D',
    id: TimeFrames.D1,
  },
  [TimeFrames.W1]: {
    text: 'W',
    id: TimeFrames.W1,
  },
};

// format the data like this:
const data = [
  {
    time: 1742961600000,
    open: 575.19,
    high: 576.33,
    low: 567.19,
    close: 568.59,
    volume: 51848300,
  },
  {
    time: 1742961600000,
    open: 575.19,
    high: 576.33,
    low: 567.19,
    close: 568.59,
    volume: 51848300,
  },
];

function App() {
  const [loading, setLoading] = useState(true);
  const [fullscreen, setFullscreen] = useState(false);
  const [timeframe, setTimeframe] = useState(timeframes.D1);
  const [config, setConfig] = useState({});

  return (
    <CandlesChart
      loading={loading}
      config={{
        width: 960,
        height: 560,
        symbol: {
          name: 'Apple Inc.',
          code: 'AAPL',
        },
        decimals: 2,
        symbolClick: true,
        fullscreen: false,
        showFullscreenButton: false,
        initialCandlesWindow: defaultRequestBars,
        timeframe,
        timeframes: values(timeframes),
        timeframesMenu: {
          Minute: [timeframes.M15, timeframes.M30],
          Hour: [timeframes.H1, timeframes.H4],
          'Day/Week': [timeframes.D1, timeframes.W1],
        },
      }}
      data={data}
      onConfig={setConfig}
      onTimeframeChange={setTimeframe}
      onLoadMore={() => {
        console.log('load more candles and update data...');
      }}
      onSymbolClick={() => {
        console.log('symbol clicked, code your');
      }}
      onFullscreen={setFullscreen}
    />
  );
}

Custom Theme

You can fully customize the chart's theme by passing a theme property to the config prop, using the following structure:

config.theme = {
  colors: 'string[]',
  bgColor: 'string',
  borderRadius: 'number',
  primary: 'string',
  lineColor: 'string',
  lineWidth: 'number',
  lineCircleSize: 'number',
  candleUpColor: 'string',
  candleDownColor: 'string',
  fontFamily: 'string',
  fontSize: 'number',
  fontWeight: 'number',
  color: 'string',
  padding: '[number, number, number, number]',
  title: {
    fontSize: 'number',
    marginBottom: 'number',
    color: 'string',
    colorHover: 'string',
  },
  subtitle: {
    fontSize: 'number',
    marginBottom: 'number',
    color: 'string',
    colorHover: 'string',
  },
  header: {
    angleDownSize: 'number',
    angleDownColor: 'string',
    angleDownColorHover: 'string',
    toolbarBorderColor: 'string',
    buttonFontSize: 'number',
    buttonColor: 'string',
    buttonColorHover: 'string',
    buttonColorActive: 'string',
    buttonBgColorActive: 'string',
    buttonBorderColor: 'string',
    buttonBorderColorActive: 'string',
    marginRight: 'number',
    background: 'string',
  },
  legend: {
    fontSize: 'number',
    color: 'string',
    itemMarginRight: 'number',
    itemMarginBottom: 'number',
    marginBottom: 'number',
    circle: {
      positionTop: 'number',
      size: 'number',
      marginRight: 'number',
      lineWidth: 'number',
    },
  },
  grid: {
    lineColor: 'string',
    showY: 'boolean',
    showX: 'boolean',
  },
  axes: {
    fontSize: 'number',
    color: 'string',
    emphasizeColor: 'string',
    lineColor: 'string',
    tickColor: 'string',
    tickSize: 'number',
    tickMargin: 'number',
    lastValueTickBgSize: 'number',
    xEndShiftRatio: 'number',
    minTickWidthX: 'number',
    minTickSpaceY: 'number',
    hoverColor: 'string',
  },
  indicatorWindow: {
    splitLineColor: 'string',
    splitLineWidth: 'number',
    bgColor: 'string',
    color: 'string',
    settingsColor: 'string',
  },
  crosshair: {
    color: 'string',
    tickColor: 'string',
    tickBgColor: 'string',
    lineColor: 'string',
    lineDash: '[number, number]',
  },
  ohlcvOverlay: {
    keyColor: 'string',
    valueColor: 'string',
    fontSize: 'number',
    overlayMarginTop: 'number',
    overlayMarginBottom: 'number',
    overlayMarginRight: 'number',
    itemMarginBottom: 'number',
    itemMarginRight: 'number',
    colMarginRight: 'number',
  },
  menu: {
    bgColor: 'string',
    borderColor: 'string',
    borderWidth: 'number',
    borderRadius: 'number',
    padding: 'number',
    item: {
      padding: 'number',
      fontSize: 'number',
      color: 'string',
      colorHover: 'string',
      colorActive: 'string',
      bgColorHover: 'string',
      bgColorActive: 'string',
      borderRadius: 'number',
    },
  },
  input: {
    labelColor: 'string',
    labelBgColor: 'string',
    color: 'string',
    bgColor: 'string',
    bgColorHover: 'string',
    bgColorDarker: 'string',
    bgColorDarkerHover: 'string',
  },
  button: {
    borderColor: 'string',
    borderColorHover: 'string',
    borderColorActive: 'string',
    color: 'string',
    colorHover: 'string',
    colorActive: 'string',
  },
  popoverMenu: {
    zIndex: 'number',
    background: 'string',
    bgColor: 'string',
    borderColor: 'string',
    color: 'string',
    uppercaseColor: 'string',
  },
  indicatorsMenu: {
    titleColor: 'string',
    subtitleColor: 'string',
    indicatorTextColor: 'string',
    borderColor: 'string',
    settingsColor: 'string',
    buttonBgColor: 'string',
    buttonBorderColor: 'string',
    buttonBorderColorActive: 'string',
    labelColor: 'string',
    addIconColor: 'string',
    addIconColorActive: 'string',
    settingsColorActive: 'string',
    removeIconColor: 'string',
  },
  drawingToolbar: {
    colors: 'string[]',
    iconColor: 'string',
    bgColor: 'string',
    borderColor: 'string',
    closeColor: 'string',
    closeBgColor: 'string',
    textColor: 'string',
    textColorActive: 'string',
    textBgColor: 'string',
  },
  switch: {
    activeBgColor: 'string',
    inactiveBgColor: 'string',
    activeColor: 'string',
    inactiveColor: 'string',
  },
  dragList: {
    topZIndex: 'number',
    borderColor: 'string',
    bgColorHover: 'string',
    handleBgColorHover: 'string',
    handleColor: 'string',
  },
  close: {
    bgColorActive: 'string',
    color: 'string',
    colorHover: 'string',
    colorActive: 'string',
  },
  indicators: {
    bb: {
      bgColor: 'string',
      upperlineColor: 'string',
      middlelineColor: 'string',
      lowerlineColor: 'string',
    },
    macd: {
      bgColor: 'string',
      histogramColor: 'string',
      histogramBgColor: 'string',
      signalLineColor: 'string',
      signalLineBgColor: 'string',
      histogramBarColor: 'string',
      histogramBarBgColor: 'string',
    },
    roc: {
      zeroLineColor: 'string',
    },
    rsi: {
      bgColor: 'string',
      upperLineColor: 'string',
      lowerLineColor: 'string',
      middleLineColor: 'string',
    },
    stochastic: {
      bgColor: 'string',
      upperLineColor: 'string',
      lowerLineColor: 'string',
      middleLineColor: 'string',
    },
  },
};