Coder Social home page Coder Social logo

Responsive sizing of text elements about ggiraph HOT 4 OPEN

z3tt avatar z3tt commented on August 23, 2024
Responsive sizing of text elements

from ggiraph.

Comments (4)

davidgohel avatar davidgohel commented on August 23, 2024

hello,

sorry for the delay.

the font size in the tooltips stays the same

I am not sure how it should be done, let's keep this issue open for now

font sizes of ggplot2 text elements consistent when the plot gets resized

That point will not be possible. 'ggiraph' produce a real R graphic (R device) and fonts metrics are calculated when the plot is created by R.

from ggiraph.

z3tt avatar z3tt commented on August 23, 2024

Hey David, no problem and thanks for getting back to this.

I feared that it will not be possible to fix the font sizes, too bad.

For the tooltips, I assume that specifying the font sizes as em or rem and not as pt or px is the way to go? You are the expert here, but at least that's my usual approach outside of ggiraph.

from ggiraph.

davidgohel avatar davidgohel commented on August 23, 2024

The size of text (and point size) is managed by R itself. But the tooltip is managed with simple CSS independently.

Using 1rem (for example), will be understood as 1rem relative to the web page, I think you'd like to have 1rem relative to:

  • the svg zoom level
  • and an initial fixed size value

Is that right? I think I'm in the process of formalizing the need by trying to formulate it :)

from ggiraph.

z3tt avatar z3tt commented on August 23, 2024

Hm, good question :) Not sure what works best here but sometimes the tooltip text just becomes too large when decreasing the plot size.

In general I think both behaviors might be helpful: tooltip text with a fixed size or relative to the "original" text size. As the text of the plot itself shrinks, I personally would expect the same to happen for the tooltip text by default.

No time to play around with it right now but I'll give it a few more trials.

from ggiraph.

Related Issues (20)

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.