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/histogram #32

Merged
merged 5 commits into from
Aug 17, 2024
Merged

Conversation

robertacrmota
Copy link
Contributor

@robertacrmota robertacrmota commented Aug 12, 2024

  • Added JS and CSS dependency files required for histogram functionality

  • Introduced histogram_data and histogram_settings parameters for the template rendering:

    1. The histogram_data parameter contains the data used to generate the histogram. Acceptable data types include unsigned integer, signed integer, float, string, and date string in the format YYYY-MM-DD.
    2. The histogram_settings parameter allows customization of the histogram's appearance. Available settings include title, width, height, bin count, bin fill color, bin selected fill color, bin unselected fill color, and bin context fill color.

E.g. custom appearance:
histogram_arvix_dark

E.g. integration of the histogram with the scatterplot:
histogram_cord19

E.g. integration of the histogram with the search field:
histogram_wikipedia

…ucture

- Added `d3_histogram_style.css` into the `./static/css/` directory.
- Added `d3_histogram.js` under the `./static/js/` directory.
- Relocated `data_selection_manager.js` to the `./static/js/` directory.
- Updated setup.cfg to include rcssmin
- This addition is necessary for minifying CSS dependency files.
- Implemented `_get_css_dependency_sources()` to gather and optionally minify CSS dependency files.

- Implemented `_get_js_dependency_urls()` to gather JS dependency URLs.

- Updated `render_html` to include additional parameters for histogram functionality:
1. `histogram_data`: Accepts a list or a Pandas Series to provide data for generating a histogram. If provided, the histogram is rendered; otherwise, it remains disabled.
2. `histogram_settings`: Introduced a dictionary to customize histogram appearance: `histogram_width`, `histogram_height`, `histogram_bin_count`, `histogram_title`, `histogram_bin_fill_color`, `histogram_bin_selected_fill_color`, `histogram_bin_unselected_fill_color`, and `histogram_bin_context_fill_color`.
- Added dynamic inclusion of JS dependency URLs (e.g. d3.min.js) and CSS dependency files (e.g. histogram styles)

- Added JS logic to create, select, and dynamically configure the appearance of the histogram.
@lmcinnes
Copy link
Contributor

Looks like a great contribution. Thank you!

@lmcinnes lmcinnes merged commit d9f2d4c into TutteInstitute:main Aug 17, 2024
2 checks passed
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