Skip to content

Commit

Permalink
docs: add diplodoc documentation (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
korvin89 authored Feb 11, 2025
1 parent 964b3b5 commit f18dba4
Show file tree
Hide file tree
Showing 57 changed files with 12,805 additions and 127 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/docs-deploy-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test documentation deployment

on:
pull_request:
branches:
- main

jobs:
test-docs-deploy:
name: Test documentation deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install tsconfig
run: npm i @gravity-ui/tsconfig
- name: Install dependencies
run: npm run docs:deps
- name: Build
run: npm run docs:build
39 changes: 39 additions & 0 deletions .github/workflows/docs-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Documentation Deploy

on:
push:
branches:
- main

jobs:
deploy:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install tsconfig
run: npm i @gravity-ui/tsconfig
- name: Install dependencies
run: npm run docs:deps
shell: bash
- name: Build
run: npm run docs:build
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist-docs
cname: gravity-ui.com
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
2 changes: 1 addition & 1 deletion .github/workflows/pr-preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: gravity-ui/preview-build-action@v1
- uses: gravity-ui/preview-build-action@v2
with:
node-version: 18
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ node_modules

# Artifacts
dist
dist-docs
docs/diplodoc/pages/api
storybook-static
.cache
.tmp
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
## Install

```shell
npm install --save-dev @gravity-ui/uikit @gravity-ui/charts
npm install @gravity-ui/uikit @gravity-ui/charts
```

## Development
Expand Down
11 changes: 11 additions & 0 deletions docs/diplodoc/.yfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

allowHTML: true
staticContent: true
addSystemMeta: true
lang: en
langs:
- en
search:
provider: local
confidence: phrased
tolerance: 2
12 changes: 12 additions & 0 deletions docs/diplodoc/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title: Gravity UI Charts
base: ./
meta:
title: Gravity UI Charts
noIndex: true
links:
- title: Overview
href: ./pages/overview.md
- title: Get started
href: ./pages/get-started.md
- title: API
href: ./pages/api/overview.md
15 changes: 15 additions & 0 deletions docs/diplodoc/pages/get-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Get started

## Install

```shell
npm install @gravity-ui/uikit @gravity-ui/charts
```

## Development

To start the development server with storybook run the following:

```shell
npm run start
```
43 changes: 43 additions & 0 deletions docs/diplodoc/pages/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Overview

## About Gravity UI Charts

**Gravity UI Charts** is a charting library built with [D3](https://d3js.org/) and [React](https://react.dev/). It's designed as part of the [Gravity UI](https://gravity-ui.com/) ecosystem and provides powerful data visualization capabilities for modern web applications through simple configuration objects.

{% note warning %}

While the library is in version `0.*.*`, minor releases may include incompatible changes to the API.

{% endnote %}

## What you can already do with Gravity UI Charts

We have already implemented support for the main chart types:

- `Area`
- `Bar-X`
- `Bar-Y`
- `Line`
- `Pie`
- `Scatter`
- `Treemap` (partial support)
- `Waterfall` (partial support)

{% cut "Examples from Storybook" %}

<iframe
src="https://preview.gravity-ui.com/charts/iframe.html?args=&globals=&id=showcase--d-3-showcase-story&viewMode=story"
width="100%"
height="400"
></iframe>

{% endcut %}

## Roadmap

We are actively working on library development and continuously improving its features. Here is the list of the priority major features:

- ⏳ Handling null data [#28](https://github.com/gravity-ui/charts/issues/28)
- ⏳ Charts zooming [#29](https://github.com/gravity-ui/charts/issues/29)
- ⏳ Plot lines, bands [#30](https://github.com/gravity-ui/charts/issues/30)
- ⏳ Charts navigator [#35](https://github.com/gravity-ui/charts/issues/35)
27 changes: 27 additions & 0 deletions docs/diplodoc/toc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
title: ''
href: index.yaml
navigation:
logo:
url: '/charts'
dark:
icon: https://storage.yandexcloud.net/gravity-ui-assets/gravity-logo-dark.svg
text: Charts
light:
icon: https://storage.yandexcloud.net/gravity-ui-assets/gravity-logo-light.svg
text: Charts
header:
leftItems:
- text: Github ➚
type: link
url: https://github.com/gravity-ui/charts
rightItems:
- type: controls
- type: search
items:
- name: Overview
href: ./pages/overview.md
- name: Get started
href: ./pages/get-started.md
- name: API
href: ./pages/api
autodoc: true
4 changes: 4 additions & 0 deletions docs/docs-gen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"pathToTocFile": "./diplodoc/toc.yaml",
"pathToDocsFolder": "./diplodoc"
}
31 changes: 31 additions & 0 deletions docs/gulpfile.docs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const {exec} = require('node:child_process');
const path = require('node:path');

const browserSync = require('browser-sync').create();
const {watch, series, parallel} = require('gulp');

const DIST_PATH = '../dist-docs';

function build(cb) {
exec('npm run docs:build', (err, stdout, stderr) => {
process.stdout.write(stdout);
process.stdout.write(stderr);
cb(err);
});
}

function serve(cb) {
browserSync.init({server: path.resolve(DIST_PATH), port: 7007});
cb();
}

function reload(cb) {
browserSync.reload();
cb();
}

function watchFiles() {
watch(['./diplodoc/**/*', './src/**/*', '../src/**/*'], series(build, reload));
}

exports.default = series(build, parallel(serve, watchFiles));
Loading

0 comments on commit f18dba4

Please sign in to comment.