Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm run format:check
- run: npm run typecheck
- run: npm run build
- run: npm test
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@ QuickChart for Javascript
---
[![npm](https://img.shields.io/npm/v/quickchart-js)](https://www.npmjs.com/package/quickchart-js)
[![npm](https://img.shields.io/npm/dt/quickchart-js)](https://www.npmjs.com/package/quickchart-js)
[![Build Status](https://travis-ci.com/typpo/quickchart-js.svg?branch=master)](https://travis-ci.com/typpo/quickchart-js)
[![CI](https://github.com/typpo/quickchart-js/actions/workflows/ci.yml/badge.svg)](https://github.com/typpo/quickchart-js/actions/workflows/ci.yml)

This is a Javascript client for [quickchart.io](https://quickchart.io), a web service for generating static charts. View the main QuickChart repository [here](https://github.com/typpo/quickchart).

# Installation

If you are using npm:

```
npm install quickchart-js
```

Requires Node.js 18 or newer (the library uses the built-in `fetch`, so there are no runtime HTTP dependencies). It ships with CommonJS, ES module, and browser builds, plus TypeScript type definitions.

# Usage

This library provides a **QuickChart** object. Import it, instantiate it, and set your [Chart.js](https://www.chartjs.org) config:
This library provides a **QuickChart** object. Import it, instantiate it, and set your [Chart.js](https://www.chartjs.org) config.

Using ES modules or TypeScript:

```js
const QuickChart = require('quickchart-js');
import QuickChart from 'quickchart-js';

const myChart = new QuickChart();
myChart.setConfig({
Expand All @@ -28,6 +30,12 @@ myChart.setConfig({
});
```

Or using CommonJS:

```js
const QuickChart = require('quickchart-js');
```

Use `getUrl()` on your quickchart object to get the encoded URL that renders your chart:

```js
Expand Down Expand Up @@ -225,22 +233,28 @@ qc.setConfig({

# Building the library

Install dependencies:

```
npm install
```

To build this library locally, run:

```
yarn build
npm run build
```

To run tests:

```
yarn test
npm test
```

If you're editing the library and running examples, you may want to continuously build the library in the background:

```
yarn build:watch
npm run build:watch

# ...

Expand Down
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

Loading
Loading