GithubHelp home page GithubHelp logo

catmaply's People

Contributors

christophbaur avatar yvesmauron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

catmaply's Issues

Field coloring does not depend on category order

At the moment, field coloring is dependent on the category order in the data frame. See this example:

library(catmaply)

df <- vbz[[1]]$data

# ordering smallest to largest Kat
df <- df %>% arrange(-desc(Ausl_Kat))

catmaply(
  df,
  x = fahrt_seq,
  y = halt_seq,
  vals = Ausl_Kat
)

# ordering largest to smallest Kat
# inverses color order
df <- df %>% arrange(desc(Ausl_Kat))

catmaply(
  df,
  x = fahrt_seq,
  y = halt_seq,
  vals = Ausl_Kat
)

Field colors should be in ascending order based on the respective category column.

Adjust naming categorical_colorbar

Parameter categorical_colorbar is not entirely correct, as it can also be used with no legend at all and display categorical color_ranges per category.

Rename it to categorical_color_range

"Padded" heatmap

I apologise if I'm missing something, but after looking around I haven't found a way to implement the xgap and ymap traces in order to add some white space between the "bricks". Please let me know if there is any way to do this or if it could be implemented.

Thanks for your work developing this package.

fix cran release

Describe the bug
Package cannot be deployed to CRAN:

Error message:

Please see the problems shown on
https://cran.r-project.org/web/checks/check_results_catmaply.html.

In particular, please see the "Found the following HTML validation
problems" NOTEs in the "HTML version of manual" check for the r-devel
debian checks results.

R 4.2.0 switched to use HTML5 for documentation pages. Now validation
using HTML Tidy finds problems in the HTML generated from your Rd files
of the form

element removed from HTML5

element removed from HTML5

attribute "align" not allowed for HTML5

attribute "hspace" not allowed for HTML5

attribute "width" has invalid value "120px"

attribute "width" has invalid value "480px"

attribute "width" has invalid value "50px"

attribute "width" has invalid value "72px"

For the first four, please see
https://html.spec.whatwg.org/#obsolete-but-conforming-features for
info on these: in principle, all can be fixed by using style attributes,
e.g.

style='text-align: right;'

instead of align='right' etc., which will work for both the new and old
ways of converting Rd to HTML.

For the second four, simply drop the px units: the HTML5 standard asks
for a non-negative integer implied to be in CSS pixels.

Can you please fix as necessary?

Note that the problems are found in Rd files auto-generated with
roxygen2: to fix it might suffice to re-generate these using the current
CRAN version of roxygen2.

Fix and resubmit to cran

Label formatting

  • Possibility to define if labels should be displayed or not in function call
  • Possibility to define template for label formatting

Base functionality axis

  • Possibility to select x and y axis columns; ordering should be dynamic by any other column.
  • Possibility to set size, color and orientation of text in function call
  • Possibility to set axis position/side in function call

Add examples to Readme.md

Add some examples of the usage of catmaply directly to the "front page" (Readme.md) in this repository. Idea: Get a good first impression of what catmaply does without having to install it.

Field formatting

  • Possibility to set columns for fields in function call, ordered by x and y.
  • Possibility to set categorical style (background color) with color palette
  • Possibility to set annotation
  • Empty fields need to be shown and should be white.

improve discrete_coloring

currently, it is not allows to use custom color ranges per categories with the catmaply_single trace. It should be possible to:

  • add a color range per category similar to catmaply_traces
  • dynamically increase colorbar based on the number of elements displayed in it

also; when using catmaply single without displaying the legend; warnings should be thrown that

  • parameter categorical_colorbar will be ignored
  • parameter categorical_col will be ignored

Wrong categorical color range when "legend_interactive = FALSE"

Describe the bug
When plotting with a categorical color range and no interactive legend ("legend_interactive = FALSE"), the color range is biased, some values appear as if they belong to a different category than they actually are in.

Thanks for considering the issue.
I'll be ready for eventual questions.
Cheers, Simon

To Reproduce
To reproduce you can use the available "vbz" data.
The code to reproduce is given below. Execute it onec as it is and an other time with the option "legend interactive = TRUE":

data("vbz")
df <- vbz[[3]]

catmaply(
df,
x = trip_id,
x_order = trip_seq,
y = stop_name,
y_order = stop_seq,
z = occupancy,
categorical_color_range = TRUE,
categorical_col = occ_category,
legend_interactive = FALSE,
hover_template = paste(
"Time:", departure_time,
"
Stop:", stop_name,
"
Occupancy:", occupancy,
"
Occupancy Category:", occ_cat_name,
"
No Of Measurements:", number_of_measurements,
""
),
legend_col = occ_cat_name
)

Expected behavior
I would expect the colors in the plot to stay the same for each square within the heatmap plot, since neither the values nor their categories change. It's just the legend type which changes. Instead, the colors are shifted such that for some of the squares the category seems to change, which is not true.
With the interactive legend the color category and the variable category seem to match, whereas with the non-interactive legend, they seem to be offset.

Screenshots
Screenshot of a non-interactive example, where a square (courseno.: 17020, station name: Zuerich, Kreuzplatz) with a value of the category "medium high" appears in a color which clearly is within the color palette of the category "high":
image

The very same example but this time with the interactive legend shows, that the same square now belongs to the correct category "medium high":
image

Environment:
Append result of sessionInfo().
sessionInfo.txt

Hovertext when empty

Hover generates "%{text} medium high" at empty fields. It would be better if there is no hoverinfo at empty fields.

behavoir x-axis

x-axis ignores "x_order" when input column for "x" is not the same as for "x_order". Creates some unwanted overlapping. It doesn't matter if "x" is unique or not.

Legend functionality

  • Possibility to show or hide legend in function call
  • Show / Hide fields based on click on legend
  • Define legend names based on any column in input data.frame

Allow DateTime Axis

  • Allow DateTime or Time on X Axis
  • Allow dynamic labels based on zoom on X Axis
  • Allow custom axis labels based on zoom level

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.