Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update widget to v2 #25

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open
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
6 changes: 1 addition & 5 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{
"name": "widget",
"dependencies": {
"moment": "2.22.2",
"echarts": "4.2.0-rc.2"
"echarts": "5.4.3"
},
"exportsOverride": {
"echarts": {
"js": "dist/echarts.min.js"
},
"moment": {
"js": "min/moment-with-locales.min.js"
}
}
}
6 changes: 3 additions & 3 deletions src/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ECharts Widget is a WireCloud widget that provides an easy way to to create interactive charts/graphs using the [ECharts Library](https://ecomfe.github.io/echarts-doc/public/en/index.html).
ECharts Widget is a WireCloud widget that provides an easy way to to create interactive charts/graphs using the [ECharts Library](https://echarts.apache.org/en/index.html).

## References

- [ECharts Library](https://ecomfe.github.io/echarts-doc/public/en/index.html)
- [ECharts Examples](https://ecomfe.github.io/echarts-examples/public/index.html)
- [ECharts Library](https://echarts.apache.org/en/index.html)
- [ECharts Examples](https://echarts.apache.org/examples/en/index.html)
45 changes: 43 additions & 2 deletions src/config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<widget xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="Ficodes" name="echarts" version="0.0.2">
<widget xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="Ficodes" name="echarts" version="1.0.0">
<macversion>2</macversion>

<details>
<title>ECharts widget</title>
Expand All @@ -9,7 +10,7 @@
<description>ECharts widget</description>
<longdescription>DESCRIPTION.md</longdescription>
<changelog>doc/changelog.md</changelog>
<image>images/echarts_logo_black_background.png</image>
<image>images/echarts_logo.png</image>
<doc>doc/userguide.md</doc>
<license>Apache License 2.0</license>
<issuetracker>https://github.com/Wirecloud/echarts-widget/issues</issuetracker>
Expand All @@ -20,6 +21,13 @@
</requirements>

<preferences>
<preference
name="merge"
type="boolean"
label="Merge data"
description="Merge incoming data with previous data"
default="false"
/>
</preferences>

<wiring>
Expand All @@ -30,9 +38,42 @@
description="EChart options JSON object"
friendcode="echarts_options"
/>
<outputendpoint
name="click"
type="text"
label="Click event"
description="Click event JSON object, containing the data clicked"
friendcode="*"
/>
<outputendpoint
name="dblclick"
type="text"
label="Double click event"
description="Double click event JSON object, containing the data double clicked"
friendcode="*"
/>
<outputendpoint
name="hover"
type="text"
label="Hover event"
description="Hover event JSON object, containing the data hovered"
friendcode="*"
/>
<outputendpoint
name="highlight"
type="text"
label="Highlight event"
description="Highlight event JSON object, containing the data highlighted"
friendcode="*"
/>
</wiring>

<contents src="index.html"/>
<scripts>
<script src="lib/js/echarts.min.js"/>
<script src="js/ECharts.js"/>
</scripts>
<entrypoint name="FICODES_ECharts" />
<rendering height="400px" width="30%"/>

</widget>
1 change: 1 addition & 0 deletions src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ body {
background-color: #f9f9f9;
width: 100%;
height:100%;
margin: 0;
}
9 changes: 9 additions & 0 deletions src/doc/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 1.0.0 (2023-12-28)

- Updates the widget to `macversion` 2.
- Updates the echarts library to 5.4.3.
- Allows to give the input options as a JSON string.
- Adds output endpoints for events of the chart (highlight, click, dblclick and hover).
- Adds an option to allow merging data.
- Removes unneccessary moment library.

## 0.0.2 (2019-05-03)

Initial version
31 changes: 25 additions & 6 deletions src/doc/userguide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Introduction

The echarts-widget is a WireCloud widget that provides an easy way to to create interactive charts/graphs using the [ECharts Library](https://ecomfe.github.io/echarts-doc/public/en/index.html).
The echarts-widget is a WireCloud widget that provides an easy way to to create interactive charts/graphs using the [ECharts Library](https://echarts.apache.org/en/index.html).

## Settings

Expand All @@ -12,16 +12,35 @@ There are no settings defined in this widget.

- **EChart options**: Load new ECharts options JSON.

This endpoint expects to receive an [ECharts option JSON](https://ecomfe.github.io/echarts-doc/public/en/option.html#title)
This endpoint expects to receive an [ECharts option JSON](https://echarts.apache.org/en/option.html#title)

### Output Endpoints

There are no output endpoints defined in this widget.
The following output endpoints are available and will be triggered when the corresponding event is fired. The payload of the event will follow the following format:

```json
{
"event": "event_name",
"batch": [
{
"seriesIndex": 0,
"dataIndex": 0,
"data": <Raw data object, as given in the Echarts options object>
}
...
]
}
```

- **Click event**: Click event on any data point of the chart.
- **Double click event**: Double click event on any data point of the chart.
- **Hover event**: Mouseover event on any data point of the chart.
- **Highlight event**: Hightlight of any set of data points of the chart (More info [here](https://echarts.apache.org/en/api.html#events.highlight)).

## Usage

Send to **EChart options** endpoint an [ECharts option JSON](https://ecomfe.github.io/echarts-doc/public/en/option.html#title), for example, a simple linear chart:
```
Send to **EChart options** endpoint an [ECharts option JSON](https://echarts.apache.org/en/option.html#title), for example, a simple linear chart:
```json
{
"xAxis": {
"type": "category",
Expand All @@ -39,4 +58,4 @@ Send to **EChart options** endpoint an [ECharts option JSON](https://ecomfe.gith

<a href="url"><img src="https://github.com/Wirecloud/echarts-widget/blob/develop/src/images/exampleLineChart.png" align="center" width="360px" ></a>

See more ECharts examples in [ECharts Examples Site](https://ecomfe.github.io/echarts-examples/public/index.html).
See more ECharts examples in [ECharts Examples Site](https://echarts.apache.org/examples/en/index.html).
Loading