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

Charts: Investigate and replace the current chartist library #94

Closed
softsimon opened this issue Jul 22, 2020 · 13 comments · Fixed by #738
Closed

Charts: Investigate and replace the current chartist library #94

softsimon opened this issue Jul 22, 2020 · 13 comments · Fixed by #738
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@softsimon
Copy link
Member

softsimon commented Jul 22, 2020

To fix various bugs and limitations like #70, but also add new features like hover, we need to replace the current deprecated Chartist chart library that is used throughout the site to display mempool and fee data. The graph and colors should not differ too much from the current design.

Consider the following libs:

http://dygraphs.com/
https://d3js.org/

The charting libs should also be wrapped in angular components for seamlessness and tree shaking ability.

@thehapax
Copy link

I'd like to work on this issue, please.

@softsimon softsimon assigned softsimon and thehapax and unassigned softsimon Jul 22, 2020
@thehapax
Copy link

thehapax commented Aug 2, 2020

Here's my analysis for:

Best Open Source Angular Chart Libraries with Directives

Some of the criteria I looked at were the following:

  • [A] Well maintained chart library
  • [B] Well maintained Angular directive
  • [C] Similarity of charts style to mempool.space
  • [D] Ease of use and how much work to implement and maintain
  • [E] Difficulty to transform data to chart format

Based on above criteria I ranked each one from 1 to 5, where 1 is least to 5 as most favorable
Note that [C] is based only on what I see on the examples and docs, and for some it may be possible to adjust to use the same fonts, line style, etc. but would require additional work.

I looked at the chart libaries from doing a wide search and also from these guides here:

Best Angular Chart Libraries
5 open source versions
https://www.ngdevelop.tech/best-angular-chart-libraries/

10 Best Angular Chart libraries
https://www.dunebook.com/angular-chart-library/

These are the best open-source angular chart libraries available with angular wrapper.

  • ngx-charts (Swimlane - by commercial maintainer)
  • ngx-echarts (Echarts)
  • ng2-charts (Chart.js)
  • angular-plotly.js (Plotly.js - Commercial)
  • PrimeNG Charts (Chart.js)

Which leaves us really with 2 good choices for Angular directives: Chart.js and Echarts.

===

Chart.js
[A]: 5, [B]: 5, [C]: 5, [D]: 5, [E]: 4

Notes:

ECharts -
[A]: 5, [B]: 5, [C]: 3, [D]: 5, [E]: 4

Notes:

  • well maintained, open source - from Apache but also Weibo from China
  • Has some powerful features and more options than Chart.js
  • Line Styling is not as close to mempool.space
  • Examples : https://echarts.apache.org/examples/en/index.html
  • Angular Directive:

D3.js
[A]: 5, [B]: 5, [C]: 3, [D]: 1, [E]: 4

Notes:

One more - There is Angular-nvD3 but it hasn't been updated in 4 years although build is passing. I'm not sure how we'd want to quality this - some very good examples here: http://krispo.github.io/angular-nvd3/

Dygraphs
[A]: 2, [B]: 1, [C]: 2, [D]: 5, [E]: ?

Notes:

C3.js - D3-based reusable chart library
[A]: 3, [B]: 1, [C]: 2, [D]: 5, [E]: 4

Notes:

  • Simplified version of D3.js, easy to use
  • Angular Directive more than 3 years old, unclear if actively maintained

Highcharts

  • commercial

Plotly

  • commercial

@thehapax
Copy link

thehapax commented Aug 3, 2020

Note:

Echarts chart resizing scales well on mobile simulator
Chart.js chart axes doesn't auto scale as well on mobile simulator

@thehapax
Copy link

thehapax commented Aug 4, 2020

@softsimon Yesterday, I went to built the starter app for ngx-echarts, it turned out to have a number of issues. The angular directive project appears to be still a work in progress. Several modifications needed to get it running.

Here are my detailed notes:

Production build on netlify:

@thehapax
Copy link

thehapax commented Aug 4, 2020

If you are ok with the above caveats, I'll continue work on the color/style mockups

@thehapax
Copy link

thehapax commented Aug 7, 2020

Hi - Just checked Angular directive ng2-charts, sample works fine with Angular 10.0.6, see full list of dependencies and 1 warning here, netlify deploy here

Todo:

  • Test ngx-charts (backup Angular directive option) on Angular 10
  • Create identical mockup of mempool chart using both ngx and ng2 directives.
  • Test swimlane angular directive as other option.

Regarding @wiz 's comment - I took a look at bisq.market. It looks like everything so far is just line charts - If we need to do something more complex than line, bar, radar, doughnut/pie, polar area, bubble, scatter, area then the current chart.js selection wouldn't cover it.

I assume we'll need Financial Candlestick charts for Bisq at some point, which chart.js can cover. But if we need something like a cloropleth geo map or treemap or a chord diagram, we'd need to use a different library such as echarts. How we want to represent items such as Cycles in charts could be done with a simple bar, line or pie chart but its not specified in the google doc if there are any preferences.

My other concern about graphing libraries is that Angular directives are not going to be well supported in the future. Most of them are dying or on the way out. The chart libraries are all well supported and will continue to be well supported and maintained but Angular Directives libraries are trending down in terms of support and are independent of the charting libraries. Which means in a few years there might not be any decent support for angular directives for any chart libraries. Its something to consider if we have to rely on any angular directive and if angular is the choice for development.

While chart libraries often have many developers or foundations maintaining and keeping them current, the available angular directives are often sole developers who, may choose to just abandon the project at any time. It is a risk to consider. If we select an angular directive that is maintained now, it might not keep up with the latest Angular core release in 1 year.

@thehapax
Copy link

thehapax commented Aug 7, 2020

Note:

Echarts chart resizing scales well on mobile simulator
Chart.js chart axes doesn't auto scale as well on mobile simulator

Correction - Chart.js can look good on mobile; checked another sample source.

@thehapax thehapax removed their assignment Sep 1, 2020
@thehapax
Copy link

thehapax commented Sep 1, 2020

Currently don't have time to work on an echarts mockup so am unassign-ing self.

@wiz wiz added this to New Issues in Mempool Task Board Nov 16, 2020
@wiz wiz moved this from New Issues to Task Queue in Mempool Task Board Nov 16, 2020
@wiz
Copy link
Member

wiz commented Nov 16, 2020

@TechMiX can you look into a new chart library that would allow us to have a mouseover legend thing

@TechMiX
Copy link
Contributor

TechMiX commented Nov 17, 2020

Sure.
Even the current library has it I guess. We should first probably check that.

@wiz
Copy link
Member

wiz commented Mar 31, 2021

@RandyMcMillan do you want to look into replacing our chart library? would be nice to hear your ideas on this

@RandyMcMillan
Copy link
Contributor

@wiz
per our conversation - i would rather implement the statsd network statistics service - i already have a head start on this

@wiz
Copy link
Member

wiz commented Mar 31, 2021

What is statsd? Maybe make a separate issue for that, I'm not familiar with it

@softsimon softsimon added this to the v2.3 milestone Jun 12, 2021
@softsimon softsimon modified the milestones: v2.3, v2.2.1 Jun 25, 2021
@MiguelMedeiros MiguelMedeiros moved this from Task Queue to Miguel's priorities in Mempool Task Board Jul 1, 2021
@MiguelMedeiros MiguelMedeiros modified the milestones: v2.2.1, v2.3 Jul 28, 2021
@MiguelMedeiros MiguelMedeiros added the enhancement New feature or request label Jul 28, 2021
@softsimon softsimon changed the title Investigate and replace the current chartist library Charts: Investigate and replace the current chartist library Aug 24, 2021
@wiz wiz closed this as completed in #738 Sep 15, 2021
Mempool Task Board automation moved this from Miguel's priorities to Done Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

6 participants