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

Feature: to_html implemented #631

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

icannotnamemyself
Copy link

@icannotnamemyself icannotnamemyself commented Mar 21, 2021

Feature: to_html finished

  1. I guess there are only two type of html can be exported as, which are
  • canvas (pixels graph)
  • svg (vector graph)

luckily , although they are two different type of graph , canvas is transformed just the same as svg.so thanks to @jojolebarjos , I can finish part of "to_canvas" quickly with reference to his to_svg method.

Here are some differences I've found bettween canvas and svg:

  1. canvas's performance in html is much better than svg
  2. canvas won't load the font automatically, so I need to write some javascript code in my html template and put a div tag in int to load the font

Fix: text overlap

  1. support font family will fix the texts overlap problem in to_svg method

when I tested the to_svg method, I found there are some text overllaped together , but after I add a font family attribute , the problem is gone

some problems

  1. some problems
  • the font load mechanism I am using might have some compability issues, but I am pretty sure it worked well in chrome and miscrosoft edge
  • there's a a lot repeat code fragment in to_svg and to_canvas methods , may need a refactoring here

@icannotnamemyself
Copy link
Author

why can't I pass those checks ........ 😭

@amueller
Copy link
Owner

amueller commented Apr 6, 2021

hey! Thanks for the PR. I thought I had remove the method, as I figured the SVG export would be enough.
Do you feel like having html output in addition to SVG is useful? What would be the use cases?

@amueller
Copy link
Owner

amueller commented Apr 6, 2021

Also, I think, CI is just broken right now and it's not your fault :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants