Giter Site home page Giter Site logo

Comments (5)

AliciaSchep avatar AliciaSchep commented on May 22, 2024 1

I think adding an option to make it easy to add overlay text would be a nice addition to this package, so I'll leave this issue open...

from iheatmapr.

AliciaSchep avatar AliciaSchep commented on May 22, 2024

You would need to pass the annotations as a list of list, e.g.

plot <- iheatmap(data = data, layout = list(annotations = list(list(text = "hi", x = 0.5, y = 0.5, xref = "x", yref = "y")))) 

Note that this kind of annotation will add a little arrow, which may not be what you want here... but can be addressed by adding showarrow = FALSE

from iheatmapr.

romert01 avatar romert01 commented on May 22, 2024

Thank you, greatly appreciate the help!

from iheatmapr.

romert01 avatar romert01 commented on May 22, 2024

Sorry to bug you again, but I have discovered a new issue related to this.

Under your suggestion, the annotation works well:
iheatmap(data = data, layout = list(annotations = list(list(text = "hi", x = 1, y = 1, xref = "x", yref = "y", showarrow = F)))) produces:
image
(please ignore the bar across the top, RStudio seemed to be glitching on image export)

However, when I try to do the same thing and add row labels, the annotation disappears:
iheatmap(data = data, layout = list(annotations = list(list(text = "hi", x = 1, y = 1, xref = "x", yref = "y", showarrow = F)))) %>% add_row_labels(ticktext = c("a", "b")) produces:
image

I was thinking that the row labels might be "overriding" the annotations, so I tried to add them on afterwards via "modify_layout", but the problem persisted.
iheatmap(data = data) %>% add_row_labels(ticktext = c("a", "b")) %>% modify_layout(list(annotations = list(list(text = "hi", x = 1, y = 1, xref = "x", yref = "y", showarrow = F)))) produced:
image

I assume this is actually a bug, or perhaps I'm simply extending the package beyond its intended use.

from iheatmapr.

romert01 avatar romert01 commented on May 22, 2024

I would like to follow up on this issue.

from iheatmapr.

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.