Code Monkey home page Code Monkey logo

ods-charts's Introduction

Orange Design System Charts

ODS Charts provides Orange Charts components to developers.
Visit ODS Charts documentation

Report bug · Request feature

Table of contents

Quick start

Several quick start options are available:

  • Clone the repo: git clone https://github.com/Orange-OpenSource/ods-charts.git
  • Install with npm: npm install ods-charts

Read the documentation for information on the library content and examples.

Status

Netlify Status npm version

Bugs and feature requests

Have a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.

Contributing

Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.

Please refer to the developer guide for information on how to build the library.

Versioning

For transparency into our release cycle and in striving to maintain backward compatibility, ODS Charts is maintained under the Semantic Versioning guidelines. Sometimes we screw up, but we adhere to those rules whenever possible.

See the Releases section of our GitHub project for changelogs for each release version of ODS Charts.

Copyright and license

Code released under the MIT License.

ods-charts's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ods-charts's Issues

Building angular test display the Warning on 'ods-charts' dependency

Building angular and angular-tour-of-heroes tests displays a Warning: depends on 'ods-charts'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

It is recommended that you avoid depending on CommonJS modules in your Angular applications. Depending on CommonJS modules can prevent bundlers and minifiers from optimizing your application, which results in larger bundle sizes. Instead, it is recommended that you use ECMAScript modules in your entire application.

Timeseries charts does not displayed axes

Prerequisites

Describe the issue

Timeseries charts does not displayed axes

Reduced test cases

Refer to the last graph of the test/html/ test
image

Axes and horizontal lines should be displayed

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome

What version of ODS Charts are you using?

v0.1.0-alpha.1

Could not find a declaration file for module 'ods-charts'.

Prerequisites

Describe the issue

I made a very simple test graph using sample at https://github.com/Orange-OpenSource/ods-charts/tree/main/test/angular-ngx-echarts and angular 17.
I had to make a few adaptations for Angular 17 not using app.module.ts anymore.

Finally I blocked on this issue at build time :

Application bundle generation failed. [8.261 seconds]
✘ [ERROR] TS7016: Could not find a declaration file for module 'ods-charts'. '/builds/OrangeMoney/Retailer/pilotagedistri/business-server/proto/proto-elastic-iframe/node_modules/ods-charts/dist/ods-charts.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/ods-charts` if it exists or add a new declaration (.d.ts) file containing `declare module 'ods-charts';` [plugin angular-compiler]
    src/app/test-ods-charts/test-ods-charts.component.ts:4:27:
      4 │ import * as ODSCharts from 'ods-charts';
        ╵                            ~~~~~~~~~~~~

I solved it by going to folder node_modules/ods-charts and move all files in "dist" folder to parent folder. Command used was : mv dist/* .

It ran well after that... but only on my local computer. Is there an issue with the packaging of the library?

Reduced test cases

  • use angular 17
  • run ng new odsbug, cd odsbug
  • run ng generate component chart
  • add following lines in package.json :
    "echarts": "^5.4.3",
    "ngx-echarts": "^17.1.0",
    "ods-charts": "^0.1.0-alpha.2",
  • run npm install
  • add following lines in src/app/chart/chart.component.html
<div
  echarts
  [options]="options"
  [merge]="mergeOptions"
  [theme]="myTheme.theme"
  class="demo-chart"
  (chartInit)="onChartInit($event)"
></div>
  • add following in src/app/chart/chart.component.ts
import { Component } from '@angular/core';
import { ECharts, EChartsOption } from 'echarts';
import { NgxEchartsModule } from 'ngx-echarts';
import * as ODSCharts from 'ods-charts';

@Component({
  selector: 'app-graph',
  standalone: true,
  imports: [NgxEchartsModule],
  templateUrl: './chart.component.html',
  styleUrls: ['./chart.component.sass'],
})
export class ChartsComponent {
  public options: EChartsOption = {
    legend: {},
    tooltip: {},
    dataset: {
      // Provide a set of data.
      source: [
        ['product', '2015', '2016', '2017'],
        ['Matcha Lattte', 43.3, 85.8, 93.7],
        ['Milk Tea', 83.1, 73.4, 55.1],
        ['Cheese Cocoa', 86.4, 65.2, 82.5],
        ['Walnut Brownie', 72.4, 53.9, 39.1],
      ],
    },
    // Declare an x-axis (category axis).
    // The category map the first column in the dataset by default.
    xAxis: { type: 'category' },
    // Declare a y-axis (value axis).
    yAxis: {},
    // Declare several 'bar' series,
    // every series will auto-map to each column by default.
    series: [{ type: 'bar' }, { type: 'bar' }, { type: 'bar' }],
  };
  public myTheme: ODSCharts.ODSChartsTheme;

  constructor() {
    this.myTheme = ODSCharts.getThemeManager({
      mode: ODSCharts.ODSChartsMode.LIGHT,
      categoricalColors: ODSCharts.ODSChartsCategoricalColorsSet.DARKER_TINTS,
      visualMapColor: ODSCharts.ODSChartsSequentialColorsSet.SEQUENTIAL_BLUE,
      lineStyle: ODSCharts.ODSChartsLineStyle.SMOOTH,
    });
  }

  public onChartInit(ec: ECharts) {
    this.options = this.myTheme
      .setDataOptions(this.options)
      .externalizeLegends(ec, '#legend')
      .externalizePopover()
      .getChartOptions();
  }
}



What operating system(s) are you seeing the problem on?

macOS, Linux

What browser(s) are you seeing the problem on?

No response

What version of ODS Charts are you using?

1.0.0 alpha 2

Reference: Dataviz colors

Description

This issue is for the moment a reference for the colors to be used in ODS Charts. It will evolve to something more specific with actions later on.

  • TODO: define actions
  • TODO: extract names, colors, etc. from the screenshot to be copyable in this issue as real strings

Screenshot 2024-01-30 at 10 28 16

Improve documentation following feedback from use

Prerequisites

Proposal

Improve documentation to give examples of the following feedback:

  • How do I use a colour that is not in one of the colour palettes provided?
  • How do you customise the content or part of the content of the popup or tooltip?
  • More detail on how to use Apache Echart's internal popup or tooltip manager (with the ODS design)

Motivation and context

These requests for changes to the documentation are the result of questions from users of the library.

Embeddable examples for Orange Design System portal

⚠️ This issue is on hold until more details are provided to start the development


Context

Boosted provides components for web developers whose the design is described in Orange Design System Design System Manager: https://system.design.orange.com

For the buttons for instance, at https://system.design.orange.com/0c1af118d/p/278ebc-buttons-standard/b/0465a6, in the "Develop" tab, we can see the rendering of the buttons available in Boosted.

It's embedded here via a specific Storybook page: https://boosted.orange.com/storybook/?path=/docs/components-buttons--docs

Description

We'd like to do the same thing for ODS Charts. Zeroheight allows us to embed elements from Storybook, but also from whatever website as iframes. The idea here would be to reproduce the same examples provided in the DSM in some test/zeroheight/*.html independent pages and embed them into the DSM.

Automatically update copyright dates

Description

This repository contains legal headers (or other files) containing the current year.

The idea in this issue would be to create a JS script allowing to update these years automatically.

Minified version of the library

Description

As it's often done for JavaScript libraries, let's provide a minified version of the library too named ods-charts.min.js.

Warning message when running `test/vue` example locally

Description

Everything's in the title: when running npm run dev locally in test/vue directory, the following warning message is displayed:

> [email protected] dev
> vite

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

This issue aims to analyze what's the problem and to fix it if possible.

Add a favicon to the documentation

Description

Our documentation doesn't have any favicon files for now.

To close this issue, a favicon file (or files) should be added to all pages of the documentation.

There could be extra things to do for https://ods-charts.netlify.app/api/.

Don't forget to add the favicon file (or files) to our https://github.com/Orange-OpenSource/ods-charts/blob/main/NOTICE.txt.

Sub-tasks

Drop duplicate legal headers in `ods-charts.js`

Description

When running npm run build, dist/ods-charts.js is generated.
Due to the legal headers in all TypeScript files, dist/ods-charts.js contains several times the following header within the file:

//
// Software Name: Orange Design System Charts
// SPDX-FileCopyrightText: Copyright (c) 2023 Orange SA
// SPDX-License-Identifier: MIT
//
// This software is distributed under the MIT license.
//

Expected: only one legal header should be displayed at the top of dist/ods-charts.js when generated.

Dependabot: improve the group approach

Description

Dependabot is configured to group the bumps of dependencies. It works well but is not really handy for bumping dependencies of our 2 Angular tests projects:

  • /test/angular-tour-of-heroes
  • /test/angular-ngx-echarts

Indeed, here's an example of grouping done by Dependabot:

The problem here is that both modifications are needed to bump the Angular version in this project (the deps and the dev deps).

This issue aims to find a way to group (probably needed only for Angular) Angular dependencies in one independent Dependabot PR.

Explain how users should credit Apache ECharts in their apps

Description

It is a good practice to credit the authors of a product used when under Apache 2 license.
Since ODS Charts relies on Apache ECharts, it'd be helpful to add to our documentation some information about how to credit Apache ECharts for our users in their apps.

The tooltip or popover is displayed outside the graph and can be partially hidden.

Prerequisites

Describe the issue

If the tooltip or popover to be displayed is on the left or right of the graph, it may extend beyond the page and be partially hidden.

Reduced test cases

image

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

No response

What version of ODS Charts are you using?

v0.1.0-alpha.2

A solution for displaying a series with two colours

Prerequisites

Proposal

When representing data on a bar chart, it is possible to want to represent this data with a different colour depending on a condition on the value. For example, green for a target achieved, red otherwise.
You would then need to be able to have

  • both colours in the legend
  • the colour associated with the current value in the tooltop or popover.

Motivation and context

This need arises from a use case for the library. A workaround was to use two stacked series to represent respectively objectives achieved in green and objectives not achieved in red. Both colours are displayed in the legend. But the tooltip on a bar also displays both colours, whereas only the green or red colour is desirable depending on whether or not the objective has been achieved for the period.
NB: the use case studied also had a 3rd colour for this same series, grey, with a bar 100% high, representing data that was not available for the period.
Exemple in attached file index.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.