-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add horizontal bar chart #5154
Add horizontal bar chart #5154
Conversation
I was insecure about how deep in the code I should get my hands on, so I tried to keep my changes at a minimum. Having the rest of the features working would involve changing ColumnMappingSelect and X/Y axes settings. I think it's better to hear your thoughts on it first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rafawendel, thanks for all the detailed explanation on the context here 🙂. I've checked the feature + code and I would like to suggest a bit of a different approach.
You've probably noticed already that we have lots of customizations over Plotly and they take into account the "x" and "y" values. Some of those customizations are indeed on the "prepare" phase (those that are just some Redash -> Plotly option mapping), but others are "updates". Considering in this case we actually invert both axes, we will need to include this as an "update" in the exactly right spot, i.e.: inverting the axes and their settings as the Last step (or almost the Last 😝) should make it work as we want and with minimal risk.
(@kravets-levko you're invited to correct my understanding or to suggest other approaches 🙂)
I suggest you to check this file and its uses, so that you can base to create a new updater. There is a comment explaining the updaters in
redash/viz-lib/src/visualizations/chart/Renderer/initChart.js
Lines 16 to 22 in a1255b4
// This utility is intended to reduce amount of plot updates when multiple Plotly.relayout | |
// calls needed in order to compute/update the plot. | |
// `.append()` method takes an array of two element: first one is a object with updates for layout, | |
// and second is an optional function that will be called when plot is updated. That function may | |
// return an array with same structure if further updates needed. | |
// `.process()` merges all updates into a single object and calls `Plotly.relayout()`. After that | |
// it calls all callbacks, collects their return values and does another loop if needed. |
I've quickly tested this by adding an updater based on the updateYRanges
with an extra plotlyData
arg:
if (options.invertedAxes) {
each(plotlyData, series => {
series.orientation = "h";
const { x, y } = series;
series.x = y;
series.y = x;
});
updates.xaxis = layout.yaxis;
updates.yaxis = layout.xaxis;
console.log(layout);
console.log(plotlyData);
}
Note that the other features will keep working and the settings will also change accordingly. Extra: we can later check if it is worth it to rename the UI items too 😁 ("X axis" -> "Y axis" and so on).
Thanks again and LMK if I can be of any more help.
I've finished a working version of the horizontal bar chart. The final behavior is the same as Gabriel's GIF. In order to have the labels inverted in the UI I had to do some sneaky stuff which should be made into abstractions for better long-term maintenance. Also I couldn't fully grasp how the update functions work. In the example Gabriel gave adding layout properties to the update object resulted in changes to the layout, which was not the case for my function. Finally, there is still one problem: charts with double y axes will yield weird behaviors. To fix that I would have to go I little deeper into how |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've noticed I had forgotten to reset the state after the user changed charts, which would result in inversion of axes in other charts. Also, horizontal inversion can be safely applied to line charts. It should work for area charts, but the baseline for the area gets messed.
@@ -20,7 +20,9 @@ export function TabbedEditor({ tabs, options, data, onOptionsChange, ...restProp | |||
return ( | |||
<Tabs animated={false} tabBarGutter={20}> | |||
{map(tabs, ({ key, title, component: Component }) => ( | |||
<Tabs.TabPane key={key} tab={<span data-test={`VisualizationEditor.Tabs.${key}`}>{title}</span>}> | |||
<Tabs.TabPane key={key} tab={<span data-test={`VisualizationEditor.Tabs.${key}`}>{ | |||
isFunction(title) ? title(options) : title |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generalizing this pattern to all string arguments might be an abstraction worth considering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great work, @rafawendel! Beyond the code, it was really helpful following through the thought process in the PR description and the comments.
In terms of code, looking good - there are two small nits I noticed while going through it (see comments below).
In terms of functionality: currently the chart stops rendering when moving one of the series to the second Y axis. You mentioned already that there are issues with this, but my suggestion is: let's disable this functionality when Horizontal Chart is selected. If there will be demand/valid use cases, we can look into adding support for it. Wdyt?
let { label, multiple } = MappingTypes[type] | ||
// this inverts the ui, as the data will be inverted on render | ||
if (isAxesInverted) { | ||
if (type === "x") { | ||
label = label.replace("X", "Y"); | ||
} else if (type === "y") { | ||
label = label.replace("Y", "X"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something in the formatting looks off, worth running Prettier here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm run prettier
currently doesn't include the viz-lib
😅, I'll fix that.
@rafawendel I think for it to work in vscode you'll need to manually specify the settings path to client/prettier.config.js
for the workspace.
@@ -271,4 +285,4 @@ export default function GeneralSettings({ options, data, onOptionsChange }) { | |||
); | |||
} | |||
|
|||
GeneralSettings.propTypes = EditorPropTypes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer needed?
defaultChecked={options.invertedAxes} | ||
checked={options.invertedAxes} | ||
onChange={() => onOptionsChange({ invertedAxes: !options.invertedAxes })}> | ||
Horizontal chart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Horizontal chart | |
Horizontal Chart |
Thank you @arikfr, it's flattering to hear it coming from you! I find it a great idea! I was wondering whether it would be as laborious to add the second x axis as just disabling the second y axis. Now the second one sounds best. Look forward to doing it ASAP |
TLDR Code is ready: it now deals with right Y axes. Future refactoring is needed. @gabrieldutra and @arikfr I am done with dealing with the right Y axis. When the horizontal axis is disabled the right Y axis will disappear from the series' tab, Y Axis (which will be displayed as X Axis) and it's state will be reset to left Y (comments below). Therefore I think I've finished all details needed for merger. Surely I will work on any further issues you might point out or future improvements/corrections. ConclusionWorking in this involved getting my hands dirty, as I had to modify several functions around the code. The greatest problem is that most of these changes are hardcoded, which can lead to poor maintenance. In order to improve this, we would need to further discuss on the priority of creating abstractions that would increase the robustness of this feature. |
// moves any item in the right Y axis to the left one | ||
const seriesOptions = mapValues(options.seriesOptions, series => ({ | ||
...series, | ||
yAxis: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By doing this, every time horizontal chart changes state, all series go back to left Y axis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few last things I'd like to see in this PR, and it's good to go 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess it's done! Replaced the array functions with lodash's and added proptyes, which should avoid any problems
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌟
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funny thing is that I had thought of doing this. Hope to get better at it with time
Don't worry too much, you're already very good 👍 Everything else will come with experience (just learn all the time) 😉 |
Congrats on your first merged PR @rafawendel! 🎉 |
* Add toggle to disable public URLs (getredash#5140) * Add toggle to disable public URLs * Add Cypress tests * Antd v4: Fix CreateUserDialog (getredash#5139) * Antd v4: Update CreateUserDialog * Add Cypress test for user creation * Misc frontend changes from internal fork (getredash#5143) * Move CardsList to typescript (getredash#5136) * Refactor CardsList - pass a suffix for list item Adding :id to an item to be used as a key suffix is redundant and the same can be accomplished by using :index from the map function. * Move CardsList to typescript * Convert CardsList component to functional component * CR1 * CR2 * Keep selected filters when switching visualizations (getredash#5146) * getredash#4944 Query pages: keep selected filters when switching visualizations * Pass current filters to expanded widget modal * prevent assigning queries to view_only data sources (getredash#5152) * Add default limit (1000) to SQL queries (getredash#5088) * add default limit 1000 * Add frontend changes and connect to backend * Fix query hash because of default limit * fix CircleCI test * adjust for comment * Allow to clear selected tags on list pages (getredash#5142) * Convert TagsList to functional component * Convert TagsList to typescript * Allow to unselect all tags * Add title to Tags block and explicit "clear filter" button * Some tweaks * Keep additional URL params when forking a query (getredash#5184) * Refresh CSRF tokens (getredash#5177) * expire CSRF tokens after 6 hours * use axios' built-in cookie to header copy mechanism * add axios-auth-refresh * retry CSRF-related 400 errors by refreshing the cookie * export the auth refresh interceptor to support ejecting it if neccessary * reject the original request if it's unrelated to CSRF * add 'cancelled' meta directive to all cancelled jobs (getredash#5187) * Ask user to log in when session expires (getredash#5178) * Ask user to log in when session expires * Update implementation * Update implementation * Minor fix * Update modal * Do not intercept calls to api/session as Auth.requireSession() relies on it * Refine code; adjust popup size and position * Some Choropleth improvements/refactoring (getredash#5186) * Directly map query results column to GeoJSON property * Use cache for geoJson requests * Don't handle bounds changes while loading geoJson data * Choropleth: fix map "jumping" on load; don't save bounds if user didn't edit them; refine code a bit * Improve cache * Optimize Japan Perfectures map (remove irrelevant GeoJson properties) * Improve getOptions for Choropleth; remove unused code * Fix test * Add US states map * Convert USA map to Albers projection * Allow to specify user-friendly field names for maps * Align Y axes at zero (getredash#5053) * Align Y axes as zero * Fix typo (with @deecay) * Add alignYAxesAtZero function * Avoid 0 division Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> * Generate Code Coverage report for Cypress (getredash#5137) * Move Cypress to dev dependencies (getredash#3991) * Test Cypress on package list * Skip Puppeteer Chromium as well * Put back missing npm install on netlify.toml * Netlify: move env vars to build.environment * Remove cypress:install script * Update Cypress dockerfile * Copy package-lock.json to Cypress dockerfile * ScheduleDialog: Filter empty interval groups (getredash#5196) * Share Embed Spec: Make sure query is executed (getredash#5191) * Updated Cypress to v5.3 and fixed e2e tests (getredash#5199) * Upgraded Cypress to v5.3 and fixed e2e tests * Updated cypress image * Fixed failing tests * Updated NODE_VERSION in netlify * Update client/cypress/integration/visualizations/choropleth_spec.js Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> * fixed test in choropleth Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> * Extra actions on Queries and Dashboards pages (getredash#5201) * Extra actions for Query View and Query Source pages * Convert Queries List page to functional component * Convert Dashboards List page to functional component * Extra actions for Query List page * Extra actions for Dashboard List page * Extra actions for Dashboard page * Pass some extra data to Dashboard.HeaderExtra component * CR1 * Remove build args from Cypress start script (getredash#5203) * Frontend updates from internal fork (getredash#5209) * Add horizontal bar chart (getredash#5154) * added bar chart boilerplate * added x/y manipulation * replaced x/y management to inner series preparer * added tests * moved axis inversion to all charts series * removed line and area * inverted labels ui * removed normalizer check, simplified inverted axes check * finished working hbar * minor review * added conditional title to YAxis * generalized horizontal chart for line charts, resetted state on globalSeriesType change * fixed updates * fixed updates to layout * fixed minor issues * removed right Y axis when axes inverted * ran prettier * fixed updater function conflict and misuse of getOptions * renamed inverted to swapped * created mappingtypes for swapped columns * removed unused import * minor polishing * improved series behaviour in h-bar * minor fix * added basic filter to ChartTypeSelect * final setup of filtered chart types * Update viz-lib/src/components/visualizations/editor/createTabbedEditor.jsx * added proptypes and renamed ChartTypeSelect props * Add missing import * fixed import, moved result array to global scope * merged import * clearer naming in ChartTypeSelect * better lodash map syntax * fixed global modification * moved result inside useMemo Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> Co-authored-by: Levko Kravets <levko.ne@gmail.com> * Fix Home EmptyState help link (getredash#5217) * Static SAML configuration and assertion encryption (getredash#5175) * Change front-end and data model for SAML2 auth - static configuration * Add changes to use inline metadata. * add switch for static and dynamic SAML configurations * Fixed config of backend static/dynamic to match UI * add ability to encrypt/decrypt SAML assertions with pem and crt files. Upgraded to pysaml2 6.1.0 to mitigate signature mismatch during decryption * remove print debug statement * Use utility to find xmlsec binary for encryption, formatting saml_auth module * format SAML Javascript, revert want_signed_response to pre-PR value * pysaml2's entityid should point to the sp, not the idp * add logging for entityid for validation * use mustache_render instead of string formatting. put all static logic into static branch * move mustache template for inline saml metadata to the global level * Incorporate SAML type with Enabled setting * Update client/app/pages/settings/components/AuthSettings/SAMLSettings.jsx Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> Co-authored-by: Chad Chen <chad.chen@databricks.com> Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> * Fix dashboard background grid (getredash#5238) * added required to Form.Item and Input for better UI (getredash#5231) * added required to Form.Item and Input for better UI * removed required from input * Revert "removed required from input" This reverts commit b56cd76. * Redo "removed required from input" * removed typo Co-authored-by: rafawendel2010@gmail.com <rafawendel> * Fix annotation bug causing queries not to run - ORA-00933 (getredash#5179) * Fix for the typo button in ParameterMappingInput (getredash#5244) * extend the refresh_queries timeout from 3 minutes to 10 minutes (getredash#5253) * Multiselect dropdown slowness (fix) (getredash#5221) * created util to estimate reasonable width for dropdown * removed unused import * improved calculation of item percentile * added getItemOfPercentileLength to relevant spots * added getItemOfPercentileLength to relevant spots * Added missing import * created custom select element * added check for property path * removed uses of percentile util * gave up on getting element reference * finished testing Select component * removed unused imports * removed older uses of Option component * added canvas calculation * removed minWidth from Select * improved calculation * added fallbacks * added estimated offset * removed leftovers 😅 * replaced to percentiles to max value * switched to memo and renamed component * proper useMemo syntax * Update client/app/components/Select.tsx Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> * created custom restrictive types * added quick const * fixed style * fixed generics * added pos absolute to fix percy * removed custom select from ParameterMappingInput * applied prettier * Revert "added pos absolute to fix percy" This reverts commit 4daf1d4. * Pin Percy version to 0.24.3 * Update client/app/components/ParameterMappingInput.jsx Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> * renamed Select.jsx to SelectWithVirtualScroll Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> * bugfix: fix getredash#5254 (getredash#5255) Co-authored-by: Jerry <jerry.yuan@webweye.com> * Enable graceful shutdown of rq workers (getredash#5214) * Enable graceful shutdown of rq workers * Use `exec` in the `worker` command of the entrypoint to propagate the `TERM` signal * Allow rq processes managed by supervisor to exit without restart on expected status codes * Allow supervisorctl to contact the running supervisor * Add a `shutdown_worker` command that will send `TERM` to all running worker processes and then sleep. This allows orchestration systems to initiate a graceful shutdown before sending `SIGTERM` to supervisord * Use Heroku worker as the BaseWorker This implements a graceful shutdown on SIGTERM, which simplifies external shutdown procedures. * Fix imports based upon review * Remove supervisorctl config * Enable Boxplot to be horizontal (getredash#5262) * Frontend updates from internal fork (getredash#5259) * DynamicComponent for QuerySourceAlerts * General Settings updates * Dynamic Date[Range] updates * EmptyState updates * Query and SchemaBrowser updates * Adjust page headers and add disablePublish * Policy updates * Separate Home FavoritesList component * Update FormatQuery * Autolimit frontend fixes * Misc updates * Keep registering of QuerySourceDropdown * Undo changes in DynamicComponent * Change sql-formatter package.json syntax * Allow opening help trigger in new tab * Don't run npm commands as root in Dockerfile * Cypress: Remove extra execute query * Correct cleanup_query_results comment (getredash#5276) Correct comment from QUERY_RESULTS_MAX_AGE to QUERY_RESULTS_CLEANUP_MAX_AGE * Remove unwanted props from Select component (getredash#5277) * Explicitly selected props so as to avoid errors from non-wanted props * Simplified approach * Ran prettier 😬 * Fixed minor issues * Fix QuerySourceDropdown value type (getredash#5284) * Changed 'Delete Alert' into 'Delete' for consistency (getredash#5287) * Redesign desktop nav bar (getredash#5294) * Add React Fast Refresh + Hot Module Reloading (getredash#5291) * removed leftover console.log (getredash#5303) * Fix disabled hot reload flow (getredash#5306) * Sync date format from settings with clientConfig (getredash#5299) * added eslint no-console (getredash#5305) * added eslint no-console * Update client/.eslintrc.js to allow warnings Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> * Convert viz-lib to TypeScript (getredash#5310) Co-authored-by: ts-migrate <> * change item element in system status page (getredash#5323) * Obfuscate non-email alert destinations (getredash#5318) * Dropdown param search fix (getredash#5304) * fixed QueryBasedParamterInput optionFilterProp * added optionFilterProp fallback for SelectWithVirtualScroll * simplified syntax * removed optionFilterProp from QueryBasedParameterInput.jsx Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> * restricted SelectWithVirtualScroll props * Added e2e test for parameter filters * moved filter assertion to more suitable place * created helper for option filter prop assertion * moved option filter prop assertion to proper place, added result update assertion * refactor openAndSearchAntdDropdown helper * Fix parameter_spec Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> * Add Username and Password fields to MongoDB config (getredash#5314) * docs: fix simple typo, possbily -> possibly (getredash#5329) There is a small typo in redash/settings/__init__.py. Should read `possibly` rather than `possbily`. * Secret handling for Yandex, TreasureData, & Postgres/CockroachDB SSL (getredash#5312) * Bar chart e2e test (getredash#5279) * created bar-chart e2e test boilerplate * refactored assertions * added snapshots and dashboard * refactored assertions to properly deal with async * replaced loops with getters for proper workings of cypress * added a couple other bar charts * ran prettier * added a better query for bar charts * removed leftovers * moved helpers to support folder Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> * Truncate large Databricks ODBC result sizes (getredash#5290) Truncates results sets that exceed a limit taken from an environment variable called DATABRICKS_ROW_LIMIT. * Add reorder to dashboard parameter widgets (getredash#5267) * added paramOrder prop * minor refactor * moved logic to widget * Added paramOrder to widget API call * Update client/app/components/dashboards/dashboard-widget/VisualizationWidget.jsx Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> * Merge branch 'master' into reorder-dashboard-parameters * experimental removal of helper element * cleaner comment * Added dashboard global params logic * Added backend logic for dashboard options * Removed testing leftovers * removed appending sortable to parent component behavior * Revert "Added backend logic for dashboard options" This reverts commit 41ae2ce. * Re-structured backend options * removed temporary edits * Added dashboard/widget param reorder cypress tests * Separated edit and sorting permission * added options to public dashboard serializer * Removed undesirable events from drag * Bring back attaching sortable to its parent This reverts commit 163fb6f. * Added prop to control draggable destination parent * Removed paramOrder fallback * WIP (for Netflify preview) * fixup! Added prop to control draggable destination parent * Better drag and drop styling and fix for the padding * Revert "WIP (for Netflify preview)" This reverts commit 433e11e. * Improved dashboard parameter Cypress test * Standardized reorder styling * Changed dashboard param reorder to edit mode only * fixup! Improved dashboard parameter Cypress test * fixup! Improved dashboard parameter Cypress test * Fix for Cypress CI error Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> * Fix inconsistent Sankey behavior (getredash#5286) * added type casting to coerce number string into nuber * Merge branch 'master' into fix-inconsistent=sankey-behavior * typed map viz options * Partially typed what was possible * reworked data coercion * improved MapOptionsType types * readaqueted sankey rows so as to allow strings again * Use legacy resolver in pip to fix broken build (getredash#5309) Fixes getredash#5300 and fixes getredash#5307 There have been upstream (`python:37-slim` image) changes that bring in `pip` version 20.3.1, which makes new `2020-resolver` the default. Due to that, un-resolvable dependency conflicts in `requirements_all_ds.txt` now cause the build to fail. This is a workaround until the package versions can be updated to work with the new pip resolver. * Encrypt alert notification destinations (getredash#5317) * Remove unnecessary space in rq log (getredash#5345) * Fix: add a merge migration to solve multi head issue (getredash#5364) * Add unit test to test for multi-head migrations issue * Add merge migration * Fix for Cypress flakiness generated by param_spec (getredash#5349) * Bump dompurify from 2.0.8 to 2.0.17 in /viz-lib (getredash#5326) Bumps [dompurify](https://github.com/cure53/DOMPurify) from 2.0.8 to 2.0.17. - [Release notes](https://github.com/cure53/DOMPurify/releases) - [Commits](cure53/DOMPurify@2.0.8...2.0.17) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump bl from 1.2.2 to 1.2.3 in /viz-lib (getredash#5257) Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/rvagg/bl/releases) - [Commits](rvagg/bl@v1.2.2...v1.2.3) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump axios from 0.19.0 to 0.21.1 (getredash#5366) Bumps [axios](https://github.com/axios/axios) from 0.19.0 to 0.21.1. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v0.21.1/CHANGELOG.md) - [Commits](axios/axios@v0.19.0...v0.21.1) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Updated axios (getredash#5371) * Increased waiting time to avoid flakiness (getredash#5370) * Add My Dashboards filter option to the Dashboards list (getredash#5375) * Add My Dashboards filter option to the Dashboards list. Added API endpoint to get the list of a user's dashboards, similar to the My Queries feature. * Update empty dashboard list state to show an invite to create a new dashboard, like My Queries * Update to Levko's suggested approach. Clean up some of the formatting for consistency. Put the 'My Queries/Dashboards' item before the Favorites since that organization seems cleaner to me. * Address Levko's comments * extend sync_user_details expiry (getredash#5330) * Revert "Updated axios (getredash#5371)" (getredash#5385) This reverts commit 49536de. * Fix duplicate stylesheets (getredash#5396) * Upgrade RQ to v1.5 (getredash#5207) * upgrade RQ to v1.5 * set job's started_at * update healthcheck to match string worker names * delay worker healthcheck for 5 minutes from start to allow enough time to load in case many workers try to load simultaneously * log when worker cannot be found * Initial a11y improvements (getredash#5408) * Fixed jsx-a11y problems * Changed tabIndex to type number * Initial improvements to DesktopNavbar accessibility * Added accessibility to favorites list * Improved accessibility in Desktop Navbar * Improvements in Desktop navbar semantics * Added aria roles to tags list * Fixed tabindex type * Improved aria labels in query control dropdown * Added tab for help trigger close button * Fixed typo * Improved accessibility in query selector * Changed resizable role to separator * Added label to empty state close button * Removed redundant and mistaken roles * Used semantic components * Removed tabIndex from anchor tags * Removed mistakenly set menuitem role from anchors * Removed tabIndex from Link components * Removed improper hidden aria label from icon * Reverted button and link roles in anchors for minimal merge conflicts * Replaced alt attr with aria-label for icons * Removed redundant menu role * Improved accessibility of CodeBlock * Removed improper role from schema browser * Reverted favorites list to div * Removed improper presentation role in query snippets * Tracked changes for further PR * Revert "Improved accessibility of CodeBlock" * Add aria-labelledby to the associated code labels This reverts commit 00a1685. * Wrapped close icon into button * remove check datasource permission * show list dashboard * show list dashboard * show list dashboard * Add plain button (getredash#5419) * Add plain button * Minor syntax improvements * Refactor of Link component (getredash#5418) * Refactor of link component * Applied anchor-is-valid to Link component * Fixed Eslint error * Removed improper anchor uses * Fixed TS errors * show list dashboard * merge original repo * Reset failure counter on adhoc success (getredash#5394) * reset failure counter when query completes successfully via adhoc * Use "query_id" in metadata, but still allow "Query ID" for transition/legacy support * Add setting to identify email block domain (getredash#5377) * Add setting to identify email block domain ref: getredash#5368 * rename Co-authored-by: Levko Kravets <levko.ne@gmail.com> * rename and add comment Co-authored-by: Levko Kravets <levko.ne@gmail.com> * Update redash/handlers/users.py Co-authored-by: Levko Kravets <levko.ne@gmail.com> * Update redash/handlers/users.py Co-authored-by: Levko Kravets <levko.ne@gmail.com> * Add more comment to settting Co-authored-by: Levko Kravets <levko.ne@gmail.com> * feat: support Trino data-source (getredash#5411) * feat: add trino logo * feat: add trino * merge original repo * merge original repo * fix report * fix report * display query owner * check permission can view dashboard * check permission can view dashboard * fix css login * fix css login * fix css login * fix css login * fix css login * fix password user * fix css * fix css * fix sub dashboard * [Tmp] * fix css * add description * fix error build * fix css * fix css * [Change for Deployment] * zip * new version * new version * new version * new version Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com> Co-authored-by: max-voronov <70445727+max-voronov@users.noreply.github.com> Co-authored-by: Levko Kravets <levko.ne@gmail.com> Co-authored-by: Omer Lachish <omer@rauchy.net> Co-authored-by: Lingkai Kong <lingkai.kong@databricks.com> Co-authored-by: Alexander Rusanov <alexander.rusanov@gmail.com> Co-authored-by: Rafael Wendel <rafawendel2010@gmail.com> Co-authored-by: Christopher Grant <chrisgrant@lavabit.com> Co-authored-by: Chad Chen <chad.chen@databricks.com> Co-authored-by: Jonathan Hult <jonathan@jonathanhult.com> Co-authored-by: Jerry <610819267@qq.com> Co-authored-by: Jerry <jerry.yuan@webweye.com> Co-authored-by: Josh Bohde <josh@joshbohde.com> Co-authored-by: deecay <deecay@users.noreply.github.com> Co-authored-by: Jiajie Zhong <zhongjiajie955@hotmail.com> Co-authored-by: Elad Ossadon <elado7@gmail.com> Co-authored-by: Elad Ossadon <elad.ossadon@databricks.com> Co-authored-by: Patrick Yang <patrick.yang@databricks.com> Co-authored-by: Tim Gates <tim.gates@iress.com> Co-authored-by: Christopher Grant <christopher.grant@protonmail.com> Co-authored-by: Vipul Mathur <vipulmathur@users.noreply.github.com> Co-authored-by: Arik Fraimovich <arik@arikfr.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Justin Talbot <76974990+justint-db@users.noreply.github.com> Co-authored-by: Khiem Nguyen <khiem.nguyen@ttekglobal.com> Co-authored-by: Đặng Minh Dũng <dungdm93@live.com> Co-authored-by: Hải Triều Nguyễn Hồ <trieu@ltv.vn> Co-authored-by: Nguyễn Hồ Hải Triều <hohaitrieuntu@gmail.com> Co-authored-by: Nit <tin@ltv.vn>
this can be order by values? |
What type of PR is this?
Description
Addition of the horizontal bar chart as a display option for the bar chart
Plotly currently has the support for horizontal bar charts via the addition of the orientation property to the chart object.
In order to do so, I added a UI checkbox that will pass this option down and added a check for it that will add the Plotly property to the chart.
Problem 1: Plotly doesn't invert the axes, which is the behavior expected by the users
![Peek 2020-09-06 14-19](https://user-images.githubusercontent.com/44540213/92331772-6113ed80-f04f-11ea-913a-a76d40976f05.gif)
Solution 1: Remapped values so as to exchange x and y
![Peek 2020-09-06 14-23](https://user-images.githubusercontent.com/44540213/92331831-c667de80-f04f-11ea-804f-f888e9e31744.gif)
Problem 2: Remapping the values gives UI responsiveness, but it leads to UI misbehavior, such as unexpected axes (x will not accept multiple, y won't allow sorting), nonworking normalized to percent and stacked charts
![Peek 2020-09-06 14-30](https://user-images.githubusercontent.com/44540213/92331971-ac7acb80-f050-11ea-8d35-67834f2fba07.gif)
![Peek 2020-09-06 14-27](https://user-images.githubusercontent.com/44540213/92331907-42622680-f050-11ea-9de2-1dd4ab23deb0.gif)
Solution 2: In order to have X behaving as Y and vice-versa, it sounded best to me to just invert the axes after all configuration was done, which lead to the expected behavior.
![Peek 2020-09-06 14-34](https://user-images.githubusercontent.com/44540213/92331973-b0a6e900-f050-11ea-82a6-ad2fb37ac694.gif)
Remaining problems: