Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Commit

Permalink
clean up lerna packages (#286)
Browse files Browse the repository at this point in the history
* clean up lerna packages

* make demos package private
  • Loading branch information
dvdanielamoitzi authored Jun 14, 2023
1 parent ca3f8ee commit d1c7195
Show file tree
Hide file tree
Showing 8 changed files with 14,069 additions and 17,455 deletions.
82 changes: 46 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<p align="center"><img src="/docs/img/logo.png" alt="VisAhoi" width="35%" /></p>
<p align="center">
<a href="https://github.com/ffg-seva/onboarding-prototype/actions">
<img src="https://github.com/ffg-seva/onboarding-prototype/workflows/Build%20and%20deploy%20demos/badge.svg?branch=develop" alt="CI" />
<a href="https://github.com/datavisyn/visAhoi/actions">
<img src="https://github.com/datavisyn/visAhoi/workflows/Build%20and%20deploy%20demos/badge.svg?branch=develop" alt="CI" />
</a>
</p>

# Contributors

Christina Stoiber contributed to the library regarding conceptual design, evaluation, and publication.

# What is VisAhoi?
Expand All @@ -14,11 +15,11 @@ Christina Stoiber contributed to the library regarding conceptual design, evalua

# Key Features

* Integrable
* Extensible
* Reusable
* Automated
* Customizable
- Integrable
- Extensible
- Reusable
- Automated
- Customizable

# Getting Started

Expand All @@ -37,19 +38,23 @@ yarn add @visahoi/echarts
Let's enhance a bar chart with VisAhoi:

```js
import * as echarts from 'echarts';
import { ahoi } from '@visahoi/echarts';
import * as echarts from "echarts";
import { ahoi } from "@visahoi/echarts";

function render() {
const data = { /* bar chart data */ };
const data = {
/* bar chart data */
};

const chart = echarts.init(document.getElementById('vis'), null, { renderer: 'svg' });
const chart = echarts.init(document.getElementById("vis"), null, {
renderer: "svg",
});
chart.setOption({
/* EChart specification */
});

ahoi('bar-chart', chart, ahoiConfig);
};
ahoi("bar-chart", chart, ahoiConfig);
}

render();
```
Expand All @@ -58,7 +63,6 @@ Please note that VisAhoi supports currently only the SVG renderer.

📊 See the [entire source code of the bar chart example](./packages/echarts-demo/src/bar-chart.js) or explore the other [ECharts demos](https://ffg-seva.github.io/onboarding-prototype/demos/echarts-demo/build/).


## VisAhoi for Plotly.js

Install the VisAhoi adapter:
Expand All @@ -72,23 +76,26 @@ yarn add @visahoi/plotly
Let's enhance a bar chart with VisAhoi:

```js
import { ahoi } from '@visahoi/plotly';
import { ahoi } from "@visahoi/plotly";

async function render() {
const traces = { /* bar chart data */ };
const layout = { /* bar chart specification */ };
const traces = {
/* bar chart data */
};
const layout = {
/* bar chart specification */
};

const chart = await Plotly.newPlot('vis', traces, layout);
const chart = await Plotly.newPlot("vis", traces, layout);

ahoi('bar-chart', chart, ahoiConfig);
ahoi("bar-chart", chart, ahoiConfig);
}

render();
```

📊 See the [entire source code of the bar chart example](./packages/plotly-demo/src/bar-chart.js) or explore the other [Plotly.js demos](https://ffg-seva.github.io/onboarding-prototype/demos/plotly-demo/build/).


## VisAhoi for Vega-Lite

Install the VisAhoi adapter:
Expand All @@ -102,16 +109,18 @@ yarn add @visahoi/vega
Let's enhance a bar chart with VisAhoi:

```js
import vegaEmbed from 'vega-embed';
import { ahoi } from '@visahoi/vega';
import vegaEmbed from "vega-embed";
import { ahoi } from "@visahoi/vega";

async function render() {
const spec = { /* Vega-Lite specification with data */ };
const spec = {
/* Vega-Lite specification with data */
};

const chart = await vegaEmbed('#vis', spec, { renderer: 'svg' });
const chart = await vegaEmbed("#vis", spec, { renderer: "svg" });

ahoi('bar-chart', chart, ahoiConfig);
};
ahoi("bar-chart", chart, ahoiConfig);
}

render();
```
Expand All @@ -120,23 +129,23 @@ Please note that VisAhoi supports currently only the SVG renderer.

📊 See the [entire source code of the bar chart example](./packages/vega-demo/src/bar-chart.js) or explore the other [Vega-Lite demos](https://ffg-seva.github.io/onboarding-prototype/demos/vega-demo/build/).


# Supported Visualization Types

Currently VisAhoi provides the onboarding messages for following visualization types:

* Bar Chart (`bar-chart`)
* Change Matrix (`change-matrix`)
* Horizon Graph (`horizon-graph`)
- Bar Chart (`bar-chart`)
- Change Matrix (`change-matrix`)
- Horizon Graph (`horizon-graph`)

The visualization type is passed as first parameter to the `ahoi(type, chart, ahoiConfig)` function. The second paramter is the the chart instance of the used visualization library.


# Customization

The onboarding can be customized via the `ahoiConfig` parameter which is passed to the `ahoi(type, chart, ahoiConfig)` function.
It allows you to customize the onboarding messages and the backdrop.

The interface of the ahoiConfig looks like this:

```
interface IAhoiConfig {
onboardingMessages: IOnboardingMessage[];
Expand All @@ -147,6 +156,7 @@ interface IAhoiConfig {
To customize the onboarding messages, you can either pass your own onboarding messages, or adapt the automatically generated onboarding messages for your specific visualization type. To get the automatically generated messages use our function `generateBasicAnnotations()`. It returns an array of onbaording messages which you can modify or directly pass to the `ahoi()` function.

An onboarding message has the following interface:

```
interface IOnboardingMessage {
anchor: any;
Expand All @@ -160,6 +170,7 @@ interface IOnboardingMessage {

The backdrop can also be configured via the `ahoiConfig`. You can define if you want to show a backdrop at all and customize it's opacity.
The interface for the backdrop looks like this:

```
interface IBackdropConfig {
show: boolean;
Expand All @@ -169,24 +180,23 @@ interface IBackdropConfig {

# Developer Information

VisAhoi uses [lerna.js](https://[lernajs.org](https://lerna.js.org/)) to divide the soruce code into separate npm packages and demos.

VisAhoi uses [lerna.js](<https://[lernajs.org](https://lerna.js.org/)>) to divide the soruce code into separate npm packages and demos.

## Build Instructions

For a basic setup allowing you to build and run examples:

```
git clone https://github.com/ffg-seva/onboarding-prototype.git
git clone https://github.com/datavisyn/visAhoi.git
cd onboarding-prototype
npm install
npm run bootstrap
```

Afterwards you can run the following npm scripts:

* `npm run build` compiles all npm packages and builds the sources of the demo pages
* `npm start` runs all demo pages and opens them in the browser
- `npm run build` compiles all npm packages and builds the sources of the demo pages
- `npm start` runs all demo pages and opens them in the browser

In case you want to start a specific demo page for a chosen visualization library (`echarts`, `plotly`, or `vega`):

Expand Down
Loading

0 comments on commit d1c7195

Please sign in to comment.