You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/05/17 14:09:31 UTC
[GitHub] [incubator-superset] ChristianMurphy opened a new pull request #9819: feat(frontend): add ability to download dashboard and chart as image
ChristianMurphy opened a new pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819
### SUMMARY
Adds an additional menu option and functionality to export dashboards and charts as an image.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
download dashboard
![download-image-example](https://user-images.githubusercontent.com/3107513/82126452-cf136c80-9761-11ea-9c58-0491b3c7f9b5.gif)
download chart
![download-chart-example](https://user-images.githubusercontent.com/3107513/82127241-d8eb9e80-9766-11ea-9c87-1eac411a9e36.gif)
### TEST PLAN
<!--- What steps should be taken to verify the changes -->
CI and click testing.
* Pull down branch
* Start superset
* Navigate to a dashboard
* Open menu and select "Download as image"
* After some processing, a prompt to download image should appear
* Image should match dashboard
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [x] Has associated issue: #6737
- [x] Changes UI
- [ ] Requires DB Migration.
- [ ] Confirm DB Migration upgrade and downgrade tested.
- [x] Introduces new feature or API
- [ ] Removes existing feature or API
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] etr2460 commented on a change in pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
etr2460 commented on a change in pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#discussion_r426218477
##########
File path: superset-frontend/src/dashboard/components/HeaderActionsDropdown.jsx
##########
@@ -217,6 +218,17 @@ class HeaderActionsDropdown extends React.PureComponent {
onChange={this.changeCss}
/>
)}
+
+ {!editMode && (
+ <MenuItem
+ onClick={downloadAsImage(
+ '.dashboard',
+ generateFileStem(dashboardTitle),
Review comment:
instead of needing to call `generateFileStem` and passing it into `downloadAsImage`, I think it's cleaner to pass in a name/description field that `downloadAsImage` then uses to generate the file stem within the function
##########
File path: superset-frontend/src/dashboard/util/downloadAsImage.ts
##########
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { MouseEvent, MouseEventHandler } from 'react';
+import domToImage from 'dom-to-image';
+import kebabCase from 'lodash/kebabCase';
+
+/**
+ * generate a consistent file stem from a description and date
+ *
+ * @param description title or description of content of file
+ * @param date date when file was generated
+ */
+export const generateFileStem = (description: string, date = new Date()) => {
+ return `${kebabCase(description)}-${date
+ .toISOString()
+ .replace(/[: ]/g, '-')}`;
+};
+
+/**
+ * Create an event handler for turning an element into an image
+ *
+ * @param selector css selector of the parent element which should be turned into image
+ * @param fileStem name of generated file, without extension
+ * @param backgroundColor background color to apply to screenshot document
+ */
+export const downloadAsImage = (
+ selector: string,
+ fileStem: string,
+ backgroundColor = '#f5f5f5',
+): MouseEventHandler => (event: MouseEvent) => {
+ const elementToPrint = event.currentTarget.closest(selector);
+
+ if (!elementToPrint) throw new Error('printable element not found');
+
+ domToImage
+ .toJpeg(elementToPrint, { quality: 0.95, bgcolor: backgroundColor })
+ .then(dataUrl => {
+ const link = document.createElement('a');
+ link.download = `${fileStem}.jpeg`;
Review comment:
it might be personal preference, but i think `.jpg` is more common
##########
File path: superset-frontend/src/dashboard/util/downloadAsImage.ts
##########
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { MouseEvent, MouseEventHandler } from 'react';
+import domToImage from 'dom-to-image';
+import kebabCase from 'lodash/kebabCase';
+
+/**
+ * generate a consistent file stem from a description and date
+ *
+ * @param description title or description of content of file
+ * @param date date when file was generated
+ */
+export const generateFileStem = (description: string, date = new Date()) => {
+ return `${kebabCase(description)}-${date
+ .toISOString()
+ .replace(/[: ]/g, '-')}`;
+};
+
+/**
+ * Create an event handler for turning an element into an image
+ *
+ * @param selector css selector of the parent element which should be turned into image
+ * @param fileStem name of generated file, without extension
+ * @param backgroundColor background color to apply to screenshot document
+ */
+export const downloadAsImage = (
+ selector: string,
+ fileStem: string,
+ backgroundColor = '#f5f5f5',
+): MouseEventHandler => (event: MouseEvent) => {
+ const elementToPrint = event.currentTarget.closest(selector);
+
+ if (!elementToPrint) throw new Error('printable element not found');
+
+ domToImage
+ .toJpeg(elementToPrint, { quality: 0.95, bgcolor: backgroundColor })
+ .then(dataUrl => {
+ const link = document.createElement('a');
+ link.download = `${fileStem}.jpeg`;
+ link.href = dataUrl;
+ link.click();
+ });
+};
+
+export default downloadAsImage;
Review comment:
and then remove this line
##########
File path: superset-frontend/src/dashboard/util/downloadAsImage.ts
##########
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { MouseEvent, MouseEventHandler } from 'react';
+import domToImage from 'dom-to-image';
+import kebabCase from 'lodash/kebabCase';
+
+/**
+ * generate a consistent file stem from a description and date
+ *
+ * @param description title or description of content of file
+ * @param date date when file was generated
+ */
+export const generateFileStem = (description: string, date = new Date()) => {
+ return `${kebabCase(description)}-${date
+ .toISOString()
+ .replace(/[: ]/g, '-')}`;
+};
+
+/**
+ * Create an event handler for turning an element into an image
+ *
+ * @param selector css selector of the parent element which should be turned into image
+ * @param fileStem name of generated file, without extension
+ * @param backgroundColor background color to apply to screenshot document
+ */
+export const downloadAsImage = (
Review comment:
you can change this to `export default const...`
##########
File path: superset-frontend/src/dashboard/util/downloadAsImage.ts
##########
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { MouseEvent, MouseEventHandler } from 'react';
+import domToImage from 'dom-to-image';
+import kebabCase from 'lodash/kebabCase';
+
+/**
+ * generate a consistent file stem from a description and date
+ *
+ * @param description title or description of content of file
+ * @param date date when file was generated
+ */
+export const generateFileStem = (description: string, date = new Date()) => {
+ return `${kebabCase(description)}-${date
+ .toISOString()
+ .replace(/[: ]/g, '-')}`;
+};
+
+/**
+ * Create an event handler for turning an element into an image
+ *
+ * @param selector css selector of the parent element which should be turned into image
+ * @param fileStem name of generated file, without extension
+ * @param backgroundColor background color to apply to screenshot document
+ */
+export const downloadAsImage = (
+ selector: string,
+ fileStem: string,
+ backgroundColor = '#f5f5f5',
+): MouseEventHandler => (event: MouseEvent) => {
+ const elementToPrint = event.currentTarget.closest(selector);
+
+ if (!elementToPrint) throw new Error('printable element not found');
Review comment:
instead of throwing an error, it might be better to show a warning toast: https://github.com/apache/incubator-superset/blob/master/superset-frontend/src/messageToasts/actions/index.js#L69
##########
File path: superset-frontend/src/dashboard/util/downloadAsImage.ts
##########
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { MouseEvent, MouseEventHandler } from 'react';
+import domToImage from 'dom-to-image';
+import kebabCase from 'lodash/kebabCase';
+
+/**
+ * generate a consistent file stem from a description and date
+ *
+ * @param description title or description of content of file
+ * @param date date when file was generated
+ */
+export const generateFileStem = (description: string, date = new Date()) => {
+ return `${kebabCase(description)}-${date
+ .toISOString()
+ .replace(/[: ]/g, '-')}`;
+};
+
+/**
+ * Create an event handler for turning an element into an image
+ *
+ * @param selector css selector of the parent element which should be turned into image
+ * @param fileStem name of generated file, without extension
+ * @param backgroundColor background color to apply to screenshot document
+ */
+export const downloadAsImage = (
+ selector: string,
+ fileStem: string,
+ backgroundColor = '#f5f5f5',
Review comment:
can we pull this color out into a constant? Or better yet, is it defined somewhere in a theme file already as a constant to be reused here?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to export dashboard as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.70%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.86% +4.70%
==========================================
Files 585 586 +1
Lines 30427 30441 +14
Branches 3152 3156 +4
==========================================
+ Hits 20133 21573 +1440
+ Misses 10113 8756 -1357
+ Partials 181 112 -69
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `53.57% <50.00%> (?)` | |
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `71.02% <ø> (ø)` | |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...set-frontend/src/dashboard/util/downloadAsImage.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS5qcw==) | `41.66% <41.66%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `79.16% <100.00%> (+9.60%)` | :arrow_up: |
| [...rontend/src/SqlLab/components/AceEditorWrapper.tsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL0FjZUVkaXRvcldyYXBwZXIudHN4) | `56.98% <0.00%> (+1.07%)` | :arrow_up: |
| [superset-frontend/src/components/EditableTitle.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRWRpdGFibGVUaXRsZS5qc3g=) | `81.69% <0.00%> (+1.40%)` | :arrow_up: |
| [...perset-frontend/src/components/CopyToClipboard.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ29weVRvQ2xpcGJvYXJkLmpzeA==) | `36.36% <0.00%> (+1.51%)` | :arrow_up: |
| [...hboard/components/resizable/ResizableContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVDb250YWluZXIuanN4) | `71.87% <0.00%> (+1.56%)` | :arrow_up: |
| [...ashboard/components/gridComponents/ChartHolder.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0NoYXJ0SG9sZGVyLmpzeA==) | `81.35% <0.00%> (+1.69%)` | :arrow_up: |
| [superset-frontend/src/utils/common.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3V0aWxzL2NvbW1vbi5qcw==) | `69.64% <0.00%> (+1.78%)` | :arrow_up: |
| [...src/explore/components/controls/VizTypeControl.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9WaXpUeXBlQ29udHJvbC5qc3g=) | `78.84% <0.00%> (+1.92%)` | :arrow_up: |
| ... and [138 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...e0be306](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
- Coverage 66.16% 66.15% -0.02%
==========================================
Files 585 586 +1
Lines 30427 30452 +25
Branches 3152 3158 +6
==========================================
+ Hits 20133 20145 +12
- Misses 10113 10126 +13
Partials 181 181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `71.02% <ø> (-0.01%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...d/src/dashboard/components/SliceHeaderControls.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyQ29udHJvbHMuanN4) | `11.62% <ø> (ø)` | |
| [...set-frontend/src/dashboard/util/downloadAsImage.ts](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS50cw==) | `44.44% <44.44%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `70.83% <100.00%> (+1.26%)` | :arrow_up: |
| [superset/viz.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `71.91% <0.00%> (-0.10%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...b4b954e](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] villebro edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
villebro edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-656036709
> Huge thanks to @ChristianMurphy! This is a feature users have been craving for. Can I ask if this will make it into 0.37?
Absolutely @pradhangn 😃 I'm going to try to cut `0.37` today, stay tuned.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.85%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 71.02% +4.85%
==========================================
Files 585 184 -401
Lines 30427 17868 -12559
Branches 3152 0 -3152
==========================================
- Hits 20133 12690 -7443
+ Misses 10113 5178 -4935
+ Partials 181 0 -181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `?` | |
| #python | `71.02% <ø> (-0.01%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/viz.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `71.91% <0.00%> (-0.10%)` | :arrow_down: |
| [...frontend/src/profile/components/CreatedContent.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Byb2ZpbGUvY29tcG9uZW50cy9DcmVhdGVkQ29udGVudC5qc3g=) | | |
| [...-frontend/src/explore/components/RowCountLabel.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Sb3dDb3VudExhYmVsLmpzeA==) | | |
| [...frontend/src/dashboard/reducers/getInitialState.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9yZWR1Y2Vycy9nZXRJbml0aWFsU3RhdGUuanM=) | | |
| [...d/src/dashboard/components/gridComponents/Tabs.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL1RhYnMuanN4) | | |
| [...src/dashboard/components/filterscope/treeIcons.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2ZpbHRlcnNjb3BlL3RyZWVJY29ucy5qc3g=) | | |
| [...end/src/SqlLab/components/ExploreResultsButton.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL0V4cGxvcmVSZXN1bHRzQnV0dG9uLmpzeA==) | | |
| [superset-frontend/src/welcome/index.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3dlbGNvbWUvaW5kZXguanN4) | | |
| [superset-frontend/src/components/AnchorLink.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQW5jaG9yTGluay5qc3g=) | | |
| [superset-frontend/src/components/EditableTitle.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRWRpdGFibGVUaXRsZS5qc3g=) | | |
| ... and [390 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...c3edfe7](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] ChristianMurphy closed pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
ChristianMurphy closed pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to export dashboard as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **decrease** coverage by `0.14%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
- Coverage 66.16% 66.02% -0.15%
==========================================
Files 585 586 +1
Lines 30427 30441 +14
Branches 3152 3156 +4
==========================================
- Hits 20133 20099 -34
- Misses 10113 10161 +48
Partials 181 181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `70.79% <ø> (-0.23%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...set-frontend/src/dashboard/util/downloadAsImage.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS5qcw==) | `41.66% <41.66%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `70.83% <100.00%> (+1.26%)` | :arrow_up: |
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `58.92% <0.00%> (-21.43%)` | :arrow_down: |
| [superset/utils/cache.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `45.83% <0.00%> (-20.84%)` | :arrow_down: |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `78.26% <0.00%> (-13.05%)` | :arrow_down: |
| [superset/views/database/api.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvYXBpLnB5) | `83.90% <0.00%> (-3.45%)` | :arrow_down: |
| [superset/db\_engine\_specs/postgres.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3Bvc3RncmVzLnB5) | `97.29% <0.00%> (-2.71%)` | :arrow_down: |
| [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `83.77% <0.00%> (-2.36%)` | :arrow_down: |
| [superset/jinja\_context.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvamluamFfY29udGV4dC5weQ==) | `84.69% <0.00%> (-1.03%)` | :arrow_down: |
| [superset/security/manager.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc2VjdXJpdHkvbWFuYWdlci5weQ==) | `88.62% <0.00%> (-0.35%)` | :arrow_down: |
| ... and [3 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...e0be306](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] ChristianMurphy commented on a change in pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
ChristianMurphy commented on a change in pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#discussion_r426219518
##########
File path: superset-frontend/src/dashboard/util/downloadAsImage.ts
##########
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { MouseEvent, MouseEventHandler } from 'react';
+import domToImage from 'dom-to-image';
+import kebabCase from 'lodash/kebabCase';
+
+/**
+ * generate a consistent file stem from a description and date
+ *
+ * @param description title or description of content of file
+ * @param date date when file was generated
+ */
+export const generateFileStem = (description: string, date = new Date()) => {
+ return `${kebabCase(description)}-${date
+ .toISOString()
+ .replace(/[: ]/g, '-')}`;
+};
+
+/**
+ * Create an event handler for turning an element into an image
+ *
+ * @param selector css selector of the parent element which should be turned into image
+ * @param fileStem name of generated file, without extension
+ * @param backgroundColor background color to apply to screenshot document
+ */
+export const downloadAsImage = (
+ selector: string,
+ fileStem: string,
+ backgroundColor = '#f5f5f5',
Review comment:
I pulled this from https://github.com/apache/incubator-superset/blob/c53bc4ddf9808a8bb6916bbe3cb31935d33a2420/superset-frontend/stylesheets/less/variables.less#L34
Currently there is not connector pulling the less variables into JS.
I could create an adapter that tries to read the variable at runtime, or could create a new constants file, thoughts? :thought_balloon:
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] pradhangn commented on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
pradhangn commented on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-656050559
Super! Thanks @villebro and @ChristianMurphy!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.62%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.79% +4.62%
==========================================
Files 585 184 -401
Lines 30427 17868 -12559
Branches 3152 0 -3152
==========================================
- Hits 20133 12649 -7484
+ Misses 10113 5219 -4894
+ Partials 181 0 -181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `?` | |
| #python | `70.79% <ø> (-0.24%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `58.92% <0.00%> (-21.43%)` | :arrow_down: |
| [superset/utils/cache.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `45.83% <0.00%> (-20.84%)` | :arrow_down: |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `78.26% <0.00%> (-13.05%)` | :arrow_down: |
| [superset/views/database/api.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvYXBpLnB5) | `83.90% <0.00%> (-3.45%)` | :arrow_down: |
| [superset/db\_engine\_specs/postgres.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3Bvc3RncmVzLnB5) | `97.29% <0.00%> (-2.71%)` | :arrow_down: |
| [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `83.77% <0.00%> (-2.36%)` | :arrow_down: |
| [superset/jinja\_context.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvamluamFfY29udGV4dC5weQ==) | `84.69% <0.00%> (-1.03%)` | :arrow_down: |
| [superset/security/manager.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc2VjdXJpdHkvbWFuYWdlci5weQ==) | `88.62% <0.00%> (-0.35%)` | :arrow_down: |
| [superset/views/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `74.90% <0.00%> (-0.23%)` | :arrow_down: |
| [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `88.41% <0.00%> (-0.16%)` | :arrow_down: |
| ... and [400 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...c3edfe7](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to export dashboard as image (#6973)
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.79%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.96% +4.79%
==========================================
Files 585 184 -401
Lines 30427 17863 -12564
Branches 3152 0 -3152
==========================================
- Hits 20133 12676 -7457
+ Misses 10113 5187 -4926
+ Partials 181 0 -181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `?` | |
| #python | `70.96% <ø> (-0.07%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `78.26% <0.00%> (-13.05%)` | :arrow_down: |
| [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `85.25% <0.00%> (-0.89%)` | :arrow_down: |
| [superset/views/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `74.90% <0.00%> (-0.23%)` | :arrow_down: |
| [...et-frontend/src/dashboard/components/CssEditor.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0Nzc0VkaXRvci5qc3g=) | | |
| [...erset-frontend/src/messageToasts/reducers/index.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL21lc3NhZ2VUb2FzdHMvcmVkdWNlcnMvaW5kZXguanM=) | | |
| [...rontend/src/explore/components/EmbedCodeButton.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9FbWJlZENvZGVCdXR0b24uanN4) | | |
| [...explore/components/controls/AdhocFilterControl.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9BZGhvY0ZpbHRlckNvbnRyb2wuanN4) | | |
| [...ntend/src/dashboard/components/PublishedStatus.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1B1Ymxpc2hlZFN0YXR1cy5qc3g=) | | |
| [superset-frontend/src/components/Menu/Menu.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTWVudS9NZW51LmpzeA==) | | |
| [superset-frontend/src/messageToasts/propShapes.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL21lc3NhZ2VUb2FzdHMvcHJvcFNoYXBlcy5qcw==) | | |
| ... and [393 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...004c207](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to export dashboard as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **decrease** coverage by `0.00%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
- Coverage 66.16% 66.16% -0.01%
==========================================
Files 585 586 +1
Lines 30427 30441 +14
Branches 3152 3156 +4
==========================================
+ Hits 20133 20140 +7
- Misses 10113 10120 +7
Partials 181 181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `71.02% <ø> (ø)` | |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...set-frontend/src/dashboard/util/downloadAsImage.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS5qcw==) | `41.66% <41.66%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `70.83% <100.00%> (+1.26%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...e0be306](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.78%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.95% +4.78%
==========================================
Files 585 184 -401
Lines 30427 17868 -12559
Branches 3152 0 -3152
==========================================
- Hits 20133 12678 -7455
+ Misses 10113 5190 -4923
+ Partials 181 0 -181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `?` | |
| #python | `70.95% <ø> (-0.08%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `78.26% <0.00%> (-13.05%)` | :arrow_down: |
| [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `85.25% <0.00%> (-0.89%)` | :arrow_down: |
| [superset/views/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `74.90% <0.00%> (-0.23%)` | :arrow_down: |
| [superset/viz.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `71.91% <0.00%> (-0.10%)` | :arrow_down: |
| [...ontend/src/explore/components/QueryAndSaveBtns.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9RdWVyeUFuZFNhdmVCdG5zLmpzeA==) | | |
| [...nd/src/explore/components/ExploreViewContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9FeHBsb3JlVmlld0NvbnRhaW5lci5qc3g=) | | |
| [...essageToasts/utils/getToastsFromPyFlashMessages.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL21lc3NhZ2VUb2FzdHMvdXRpbHMvZ2V0VG9hc3RzRnJvbVB5Rmxhc2hNZXNzYWdlcy5qcw==) | | |
| [superset-frontend/src/components/TableSelector.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvVGFibGVTZWxlY3Rvci5qc3g=) | | |
| [...ntend/src/dashboard/components/PropertiesModal.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1Byb3BlcnRpZXNNb2RhbC5qc3g=) | | |
| [superset-frontend/src/explore/controls.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29udHJvbHMuanN4) | | |
| ... and [393 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...c3edfe7](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to export dashboard as image (#6973)
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.86%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 71.02% +4.86%
==========================================
Files 585 184 -401
Lines 30427 17863 -12564
Branches 3152 0 -3152
==========================================
- Hits 20133 12688 -7445
+ Misses 10113 5175 -4938
+ Partials 181 0 -181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `?` | |
| #python | `71.02% <ø> (ø)` | |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...tend/src/dashboard/util/getDirectPathToTabIndex.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldERpcmVjdFBhdGhUb1RhYkluZGV4Lmpz) | | |
| [superset-frontend/src/utils/errorMessages.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3V0aWxzL2Vycm9yTWVzc2FnZXMuanM=) | | |
| [...rset-frontend/src/setup/setupErrorMessagesExtra.ts](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3NldHVwL3NldHVwRXJyb3JNZXNzYWdlc0V4dHJhLnRz) | | |
| [...et-frontend/src/explore/reducers/exploreReducer.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvZXhwbG9yZVJlZHVjZXIuanM=) | | |
| [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | | |
| [...-frontend/src/dashboard/util/getDragDropManager.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldERyYWdEcm9wTWFuYWdlci5qcw==) | | |
| [...rc/dashboard/components/gridComponents/Divider.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0RpdmlkZXIuanN4) | | |
| [...oard/components/gridComponents/new/NewMarkdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL25ldy9OZXdNYXJrZG93bi5qc3g=) | | |
| [...tend/src/explore/components/ExploreChartHeader.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9FeHBsb3JlQ2hhcnRIZWFkZXIuanN4) | | |
| [...rontend/src/messageToasts/enhancers/withToasts.tsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL21lc3NhZ2VUb2FzdHMvZW5oYW5jZXJzL3dpdGhUb2FzdHMudHN4) | | |
| ... and [390 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...004c207](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.48%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.65% +4.48%
==========================================
Files 585 586 +1
Lines 30427 30450 +23
Branches 3152 3158 +6
==========================================
+ Hits 20133 21515 +1382
+ Misses 10113 8817 -1296
+ Partials 181 118 -63
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `52.78% <40.00%> (?)` | |
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `71.01% <ø> (-0.02%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...d/src/dashboard/components/SliceHeaderControls.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyQ29udHJvbHMuanN4) | `67.44% <ø> (+55.81%)` | :arrow_up: |
| [...set-frontend/src/dashboard/util/downloadAsImage.ts](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS50cw==) | `43.75% <43.75%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `79.16% <100.00%> (+9.60%)` | :arrow_up: |
| [superset/db\_engine\_specs/postgres.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3Bvc3RncmVzLnB5) | `97.29% <0.00%> (-2.71%)` | :arrow_down: |
| [superset/viz.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `71.91% <0.00%> (-0.10%)` | :arrow_down: |
| [superset-frontend/src/SqlLab/actions/sqlLab.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9hY3Rpb25zL3NxbExhYi5qcw==) | `61.13% <0.00%> (+0.65%)` | :arrow_up: |
| [...erset-frontend/src/SqlLab/components/SqlEditor.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NxbEVkaXRvci5qc3g=) | `53.84% <0.00%> (+1.28%)` | :arrow_up: |
| [superset-frontend/src/components/EditableTitle.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRWRpdGFibGVUaXRsZS5qc3g=) | `81.69% <0.00%> (+1.40%)` | :arrow_up: |
| [...perset-frontend/src/components/CopyToClipboard.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ29weVRvQ2xpcGJvYXJkLmpzeA==) | `36.36% <0.00%> (+1.51%)` | :arrow_up: |
| ... and [139 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...c3edfe7](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.81%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.98% +4.81%
==========================================
Files 585 184 -401
Lines 30427 17868 -12559
Branches 3152 0 -3152
==========================================
- Hits 20133 12684 -7449
+ Misses 10113 5184 -4929
+ Partials 181 0 -181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `?` | |
| #python | `70.98% <ø> (-0.05%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `63.33% <0.00%> (-10.01%)` | :arrow_down: |
| [superset/result\_set.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVzdWx0X3NldC5weQ==) | `96.63% <0.00%> (-1.69%)` | :arrow_down: |
| [superset/sql\_lab.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `77.63% <0.00%> (-0.44%)` | :arrow_down: |
| [superset/viz.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `71.91% <0.00%> (-0.10%)` | :arrow_down: |
| [superset-frontend/src/components/Hotkeys.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSG90a2V5cy5qc3g=) | | |
| [...uperset-frontend/src/components/TooltipWrapper.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvVG9vbHRpcFdyYXBwZXIuanN4) | | |
| [...end/src/visualizations/TimeTable/transformProps.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL1RpbWVUYWJsZS90cmFuc2Zvcm1Qcm9wcy5qcw==) | | |
| [superset-frontend/src/SqlLab/utils/sqlKeywords.ts](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi91dGlscy9zcWxLZXl3b3Jkcy50cw==) | | |
| [...uperset-frontend/src/views/chartList/ChartList.tsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL2NoYXJ0TGlzdC9DaGFydExpc3QudHN4) | | |
| [...shboard/components/filterscope/FilterFieldItem.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2ZpbHRlcnNjb3BlL0ZpbHRlckZpZWxkSXRlbS5qc3g=) | | |
| ... and [393 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...245db4c](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.49%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.66% +4.49%
==========================================
Files 585 586 +1
Lines 30427 30450 +23
Branches 3152 3158 +6
==========================================
+ Hits 20133 21516 +1383
+ Misses 10113 8816 -1297
+ Partials 181 118 -63
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `52.78% <40.00%> (?)` | |
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `71.02% <ø> (-0.01%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...d/src/dashboard/components/SliceHeaderControls.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyQ29udHJvbHMuanN4) | `67.44% <ø> (+55.81%)` | :arrow_up: |
| [...set-frontend/src/dashboard/util/downloadAsImage.ts](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS50cw==) | `43.75% <43.75%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `79.16% <100.00%> (+9.60%)` | :arrow_up: |
| [superset/viz.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `71.91% <0.00%> (-0.10%)` | :arrow_down: |
| [superset-frontend/src/SqlLab/actions/sqlLab.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9hY3Rpb25zL3NxbExhYi5qcw==) | `61.13% <0.00%> (+0.65%)` | :arrow_up: |
| [...erset-frontend/src/SqlLab/components/SqlEditor.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NxbEVkaXRvci5qc3g=) | `53.84% <0.00%> (+1.28%)` | :arrow_up: |
| [superset-frontend/src/components/EditableTitle.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRWRpdGFibGVUaXRsZS5qc3g=) | `81.69% <0.00%> (+1.40%)` | :arrow_up: |
| [...perset-frontend/src/components/CopyToClipboard.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ29weVRvQ2xpcGJvYXJkLmpzeA==) | `36.36% <0.00%> (+1.51%)` | :arrow_up: |
| [...hboard/components/resizable/ResizableContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVDb250YWluZXIuanN4) | `71.87% <0.00%> (+1.56%)` | :arrow_up: |
| ... and [138 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...c3edfe7](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.62%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.79% +4.62%
==========================================
Files 585 184 -401
Lines 30427 17868 -12559
Branches 3152 0 -3152
==========================================
- Hits 20133 12649 -7484
+ Misses 10113 5219 -4894
+ Partials 181 0 -181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `?` | |
| #python | `70.79% <ø> (-0.24%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `58.92% <0.00%> (-21.43%)` | :arrow_down: |
| [superset/utils/cache.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `45.83% <0.00%> (-20.84%)` | :arrow_down: |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `78.26% <0.00%> (-13.05%)` | :arrow_down: |
| [superset/views/database/api.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvYXBpLnB5) | `83.90% <0.00%> (-3.45%)` | :arrow_down: |
| [superset/db\_engine\_specs/postgres.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3Bvc3RncmVzLnB5) | `97.29% <0.00%> (-2.71%)` | :arrow_down: |
| [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `83.77% <0.00%> (-2.36%)` | :arrow_down: |
| [superset/jinja\_context.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvamluamFfY29udGV4dC5weQ==) | `84.69% <0.00%> (-1.03%)` | :arrow_down: |
| [superset/security/manager.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc2VjdXJpdHkvbWFuYWdlci5weQ==) | `88.62% <0.00%> (-0.35%)` | :arrow_down: |
| [superset/views/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `74.90% <0.00%> (-0.23%)` | :arrow_down: |
| [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `88.41% <0.00%> (-0.16%)` | :arrow_down: |
| ... and [400 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...b4b954e](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] etr2460 commented on a change in pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
etr2460 commented on a change in pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#discussion_r426221547
##########
File path: superset-frontend/src/dashboard/util/downloadAsImage.ts
##########
@@ -0,0 +1,70 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { SyntheticEvent } from 'react';
+import domToImage from 'dom-to-image';
+import kebabCase from 'lodash/kebabCase';
+import { addWarningToast } from 'src/messageToasts/actions';
+
+/**
+ * @remark
+ * same as https://github.com/apache/incubator-superset/blob/c53bc4ddf9808a8bb6916bbe3cb31935d33a2420/superset-frontend/stylesheets/less/variables.less#L34
+ */
+const GRAY_BACKGROUND_COLOR = '#F5F5F5';
+
+/**
+ * generate a consistent file stem from a description and date
+ *
+ * @param description title or description of content of file
+ * @param date date when file was generated
+ */
+const generateFileStem = (description: string, date = new Date()) => {
+ return `${kebabCase(description)}-${date
+ .toISOString()
+ .replace(/[: ]/g, '-')}`;
+};
+
+/**
+ * Create an event handler for turning an element into an image
+ *
+ * @param selector css selector of the parent element which should be turned into image
+ * @param description name or a short description of what is being printed.
+ * Value will be normalized, and a date as well as a file extension will be added.
+ * @param backgroundColor background color to apply to screenshot document
+ * @returns event handler
+ */
+export default function downloadAsImage(
+ selector: string,
+ description: string,
+ backgroundColor = GRAY_BACKGROUND_COLOR,
+) {
+ return (event: SyntheticEvent) => {
+ const elementToPrint = event.currentTarget.closest(selector);
+
+ if (!elementToPrint) return addWarningToast('no element to print');
Review comment:
can you wrap the string in the translation function `t`? Also since it'll be displayed to the user, let's make it something like `'Image download failed, please refresh and try again.'`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
- Coverage 66.16% 66.15% -0.02%
==========================================
Files 585 586 +1
Lines 30427 30452 +25
Branches 3152 3158 +6
==========================================
+ Hits 20133 20145 +12
- Misses 10113 10126 +13
Partials 181 181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `71.02% <ø> (-0.01%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...d/src/dashboard/components/SliceHeaderControls.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyQ29udHJvbHMuanN4) | `11.62% <ø> (ø)` | |
| [...set-frontend/src/dashboard/util/downloadAsImage.ts](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS50cw==) | `44.44% <44.44%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `70.83% <100.00%> (+1.26%)` | :arrow_up: |
| [superset/viz.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `71.91% <0.00%> (-0.10%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...b4b954e](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.62%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.79% +4.62%
==========================================
Files 585 184 -401
Lines 30427 17868 -12559
Branches 3152 0 -3152
==========================================
- Hits 20133 12649 -7484
+ Misses 10113 5219 -4894
+ Partials 181 0 -181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `?` | |
| #python | `70.79% <ø> (-0.24%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `58.92% <0.00%> (-21.43%)` | :arrow_down: |
| [superset/utils/cache.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `45.83% <0.00%> (-20.84%)` | :arrow_down: |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `78.26% <0.00%> (-13.05%)` | :arrow_down: |
| [superset/views/database/api.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvYXBpLnB5) | `83.90% <0.00%> (-3.45%)` | :arrow_down: |
| [superset/db\_engine\_specs/postgres.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3Bvc3RncmVzLnB5) | `97.29% <0.00%> (-2.71%)` | :arrow_down: |
| [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `83.77% <0.00%> (-2.36%)` | :arrow_down: |
| [superset/jinja\_context.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvamluamFfY29udGV4dC5weQ==) | `84.69% <0.00%> (-1.03%)` | :arrow_down: |
| [superset/security/manager.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc2VjdXJpdHkvbWFuYWdlci5weQ==) | `88.62% <0.00%> (-0.35%)` | :arrow_down: |
| [superset/views/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `74.90% <0.00%> (-0.23%)` | :arrow_down: |
| [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `88.41% <0.00%> (-0.16%)` | :arrow_down: |
| ... and [400 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...c3edfe7](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] pradhangn commented on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
pradhangn commented on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-655993767
Huge thanks to @ChristianMurphy! This is a feature users have been craving for. Can I ask if this will make it into 0.37?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io commented on pull request #9819: feat(frontend): add ability to export dashboard as image (#6973)
Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.63%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.79% +4.63%
==========================================
Files 585 184 -401
Lines 30427 17863 -12564
Branches 3152 0 -3152
==========================================
- Hits 20133 12647 -7486
+ Misses 10113 5216 -4897
+ Partials 181 0 -181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `?` | |
| #python | `70.79% <ø> (-0.23%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `58.92% <0.00%> (-21.43%)` | :arrow_down: |
| [superset/utils/cache.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `45.83% <0.00%> (-20.84%)` | :arrow_down: |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `78.26% <0.00%> (-13.05%)` | :arrow_down: |
| [superset/views/database/api.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvYXBpLnB5) | `83.90% <0.00%> (-3.45%)` | :arrow_down: |
| [superset/db\_engine\_specs/postgres.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3Bvc3RncmVzLnB5) | `97.29% <0.00%> (-2.71%)` | :arrow_down: |
| [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `83.77% <0.00%> (-2.36%)` | :arrow_down: |
| [superset/jinja\_context.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvamluamFfY29udGV4dC5weQ==) | `84.69% <0.00%> (-1.03%)` | :arrow_down: |
| [superset/security/manager.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc2VjdXJpdHkvbWFuYWdlci5weQ==) | `88.62% <0.00%> (-0.35%)` | :arrow_down: |
| [superset/views/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `74.90% <0.00%> (-0.23%)` | :arrow_down: |
| [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `88.41% <0.00%> (-0.16%)` | :arrow_down: |
| ... and [400 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...004c207](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.81%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.98% +4.81%
==========================================
Files 585 184 -401
Lines 30427 17868 -12559
Branches 3152 0 -3152
==========================================
- Hits 20133 12684 -7449
+ Misses 10113 5184 -4929
+ Partials 181 0 -181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `?` | |
| #python | `70.98% <ø> (-0.05%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `63.33% <0.00%> (-10.01%)` | :arrow_down: |
| [superset/result\_set.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVzdWx0X3NldC5weQ==) | `96.63% <0.00%> (-1.69%)` | :arrow_down: |
| [superset/sql\_lab.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `77.63% <0.00%> (-0.44%)` | :arrow_down: |
| [superset/viz.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `71.91% <0.00%> (-0.10%)` | :arrow_down: |
| [...set-frontend/src/components/URLShortLinkButton.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvVVJMU2hvcnRMaW5rQnV0dG9uLmpzeA==) | | |
| [...erset-frontend/src/SqlLab/components/SaveQuery.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NhdmVRdWVyeS5qc3g=) | | |
| [...-frontend/src/explore/components/RowCountLabel.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Sb3dDb3VudExhYmVsLmpzeA==) | | |
| [superset-frontend/src/addSlice/App.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2FkZFNsaWNlL0FwcC5qc3g=) | | |
| [...c/explore/components/controls/withVerification.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy93aXRoVmVyaWZpY2F0aW9uLmpzeA==) | | |
| [...tend/src/dashboard/components/DashboardBuilder.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0Rhc2hib2FyZEJ1aWxkZXIuanN4) | | |
| ... and [393 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...245db4c](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] ChristianMurphy commented on a change in pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
ChristianMurphy commented on a change in pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#discussion_r426221504
##########
File path: superset-frontend/src/dashboard/util/downloadAsImage.ts
##########
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { MouseEvent, MouseEventHandler } from 'react';
+import domToImage from 'dom-to-image';
+import kebabCase from 'lodash/kebabCase';
+
+/**
+ * generate a consistent file stem from a description and date
+ *
+ * @param description title or description of content of file
+ * @param date date when file was generated
+ */
+export const generateFileStem = (description: string, date = new Date()) => {
+ return `${kebabCase(description)}-${date
+ .toISOString()
+ .replace(/[: ]/g, '-')}`;
+};
+
+/**
+ * Create an event handler for turning an element into an image
+ *
+ * @param selector css selector of the parent element which should be turned into image
+ * @param fileStem name of generated file, without extension
+ * @param backgroundColor background color to apply to screenshot document
+ */
+export const downloadAsImage = (
+ selector: string,
+ fileStem: string,
+ backgroundColor = '#f5f5f5',
Review comment:
Sounds good, thanks!
updated
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **decrease** coverage by `0.14%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
- Coverage 66.16% 66.01% -0.15%
==========================================
Files 585 586 +1
Lines 30427 30450 +23
Branches 3152 3158 +6
==========================================
- Hits 20133 20103 -30
- Misses 10113 10166 +53
Partials 181 181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `70.79% <ø> (-0.24%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...d/src/dashboard/components/SliceHeaderControls.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyQ29udHJvbHMuanN4) | `11.62% <ø> (ø)` | |
| [...set-frontend/src/dashboard/util/downloadAsImage.ts](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS50cw==) | `43.75% <43.75%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `70.83% <100.00%> (+1.26%)` | :arrow_up: |
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `58.92% <0.00%> (-21.43%)` | :arrow_down: |
| [superset/utils/cache.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `45.83% <0.00%> (-20.84%)` | :arrow_down: |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `78.26% <0.00%> (-13.05%)` | :arrow_down: |
| [superset/views/database/api.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvYXBpLnB5) | `83.90% <0.00%> (-3.45%)` | :arrow_down: |
| [superset/db\_engine\_specs/postgres.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3Bvc3RncmVzLnB5) | `97.29% <0.00%> (-2.71%)` | :arrow_down: |
| [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `83.77% <0.00%> (-2.36%)` | :arrow_down: |
| [superset/jinja\_context.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvamluamFfY29udGV4dC5weQ==) | `84.69% <0.00%> (-1.03%)` | :arrow_down: |
| ... and [5 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...c3edfe7](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to export dashboard as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.49%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.66% +4.49%
==========================================
Files 585 586 +1
Lines 30427 30441 +14
Branches 3152 3156 +4
==========================================
+ Hits 20133 21511 +1378
+ Misses 10113 8812 -1301
+ Partials 181 118 -63
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `52.78% <50.00%> (?)` | |
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `71.02% <ø> (ø)` | |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...set-frontend/src/dashboard/util/downloadAsImage.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS5qcw==) | `41.66% <41.66%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `79.16% <100.00%> (+9.60%)` | :arrow_up: |
| [superset-frontend/src/SqlLab/actions/sqlLab.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9hY3Rpb25zL3NxbExhYi5qcw==) | `61.13% <0.00%> (+0.65%)` | :arrow_up: |
| [...erset-frontend/src/SqlLab/components/SqlEditor.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NxbEVkaXRvci5qc3g=) | `53.84% <0.00%> (+1.28%)` | :arrow_up: |
| [superset-frontend/src/components/EditableTitle.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRWRpdGFibGVUaXRsZS5qc3g=) | `81.69% <0.00%> (+1.40%)` | :arrow_up: |
| [...perset-frontend/src/components/CopyToClipboard.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ29weVRvQ2xpcGJvYXJkLmpzeA==) | `36.36% <0.00%> (+1.51%)` | :arrow_up: |
| [...hboard/components/resizable/ResizableContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVDb250YWluZXIuanN4) | `71.87% <0.00%> (+1.56%)` | :arrow_up: |
| [...ashboard/components/gridComponents/ChartHolder.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0NoYXJ0SG9sZGVyLmpzeA==) | `81.35% <0.00%> (+1.69%)` | :arrow_up: |
| [superset-frontend/src/utils/common.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3V0aWxzL2NvbW1vbi5qcw==) | `69.64% <0.00%> (+1.78%)` | :arrow_up: |
| ... and [136 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...e0be306](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to export dashboard as image (#6973)
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **decrease** coverage by `1.83%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
- Coverage 66.16% 64.33% -1.84%
==========================================
Files 585 534 -51
Lines 30427 29093 -1334
Branches 3152 2808 -344
==========================================
- Hits 20133 18716 -1417
- Misses 10113 10199 +86
+ Partials 181 178 -3
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `53.67% <50.00%> (?)` | |
| #javascript | `?` | |
| #python | `71.02% <ø> (ø)` | |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...set-frontend/src/dashboard/util/downloadAsImage.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS5qcw==) | `41.66% <41.66%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `75.00% <100.00%> (+5.43%)` | :arrow_up: |
| [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.19%)` | :arrow_down: |
| [.../src/dashboard/components/FilterIndicatorGroup.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0ZpbHRlckluZGljYXRvckdyb3VwLmpzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
| [...c/explore/components/controls/withVerification.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy93aXRoVmVyaWZpY2F0aW9uLmpzeA==) | `9.09% <0.00%> (-87.88%)` | :arrow_down: |
| [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
| [...rc/dashboard/components/gridComponents/Divider.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0RpdmlkZXIuanN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
| [...uperset-frontend/src/utils/getClientErrorObject.ts](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3V0aWxzL2dldENsaWVudEVycm9yT2JqZWN0LnRz) | `0.00% <0.00%> (-83.88%)` | :arrow_down: |
| ... and [274 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...004c207](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.70%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.86% +4.70%
==========================================
Files 585 586 +1
Lines 30427 30452 +25
Branches 3152 3158 +6
==========================================
+ Hits 20133 21581 +1448
+ Misses 10113 8760 -1353
+ Partials 181 111 -70
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `53.58% <37.50%> (?)` | |
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `71.02% <ø> (-0.01%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...d/src/dashboard/components/SliceHeaderControls.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyQ29udHJvbHMuanN4) | `67.44% <ø> (+55.81%)` | :arrow_up: |
| [...set-frontend/src/dashboard/util/downloadAsImage.ts](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS50cw==) | `44.44% <44.44%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `79.16% <100.00%> (+9.60%)` | :arrow_up: |
| [superset/viz.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `71.91% <0.00%> (-0.10%)` | :arrow_down: |
| [...rontend/src/SqlLab/components/AceEditorWrapper.tsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL0FjZUVkaXRvcldyYXBwZXIudHN4) | `56.98% <0.00%> (+1.07%)` | :arrow_up: |
| [superset-frontend/src/components/EditableTitle.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRWRpdGFibGVUaXRsZS5qc3g=) | `81.69% <0.00%> (+1.40%)` | :arrow_up: |
| [...perset-frontend/src/components/CopyToClipboard.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ29weVRvQ2xpcGJvYXJkLmpzeA==) | `36.36% <0.00%> (+1.51%)` | :arrow_up: |
| [...hboard/components/resizable/ResizableContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVDb250YWluZXIuanN4) | `71.87% <0.00%> (+1.56%)` | :arrow_up: |
| [...ashboard/components/gridComponents/ChartHolder.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0NoYXJ0SG9sZGVyLmpzeA==) | `81.35% <0.00%> (+1.69%)` | :arrow_up: |
| ... and [140 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...b4b954e](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] etr2460 merged pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
etr2460 merged pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] ChristianMurphy commented on a change in pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
ChristianMurphy commented on a change in pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#discussion_r426220791
##########
File path: superset-frontend/src/dashboard/components/HeaderActionsDropdown.jsx
##########
@@ -217,6 +218,17 @@ class HeaderActionsDropdown extends React.PureComponent {
onChange={this.changeCss}
/>
)}
+
+ {!editMode && (
+ <MenuItem
+ onClick={downloadAsImage(
+ '.dashboard',
+ generateFileStem(dashboardTitle),
Review comment:
updated
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.48%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.65% +4.48%
==========================================
Files 585 586 +1
Lines 30427 30452 +25
Branches 3152 3158 +6
==========================================
+ Hits 20133 21516 +1383
+ Misses 10113 8818 -1295
+ Partials 181 118 -63
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `52.76% <37.50%> (?)` | |
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `71.02% <ø> (-0.01%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...d/src/dashboard/components/SliceHeaderControls.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyQ29udHJvbHMuanN4) | `67.44% <ø> (+55.81%)` | :arrow_up: |
| [...set-frontend/src/dashboard/util/downloadAsImage.ts](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS50cw==) | `44.44% <44.44%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `79.16% <100.00%> (+9.60%)` | :arrow_up: |
| [superset/viz.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `71.91% <0.00%> (-0.10%)` | :arrow_down: |
| [superset-frontend/src/SqlLab/actions/sqlLab.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9hY3Rpb25zL3NxbExhYi5qcw==) | `61.13% <0.00%> (+0.65%)` | :arrow_up: |
| [...erset-frontend/src/SqlLab/components/SqlEditor.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NxbEVkaXRvci5qc3g=) | `53.84% <0.00%> (+1.28%)` | :arrow_up: |
| [superset-frontend/src/components/EditableTitle.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRWRpdGFibGVUaXRsZS5qc3g=) | `81.69% <0.00%> (+1.40%)` | :arrow_up: |
| [...perset-frontend/src/components/CopyToClipboard.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ29weVRvQ2xpcGJvYXJkLmpzeA==) | `36.36% <0.00%> (+1.51%)` | :arrow_up: |
| [...hboard/components/resizable/ResizableContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVDb250YWluZXIuanN4) | `71.87% <0.00%> (+1.56%)` | :arrow_up: |
| ... and [138 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...b4b954e](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.70%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.87% +4.70%
==========================================
Files 585 586 +1
Lines 30427 30450 +23
Branches 3152 3158 +6
==========================================
+ Hits 20133 21580 +1447
+ Misses 10113 8759 -1354
+ Partials 181 111 -70
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `53.59% <40.00%> (?)` | |
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `71.02% <ø> (-0.01%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...d/src/dashboard/components/SliceHeaderControls.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyQ29udHJvbHMuanN4) | `67.44% <ø> (+55.81%)` | :arrow_up: |
| [...set-frontend/src/dashboard/util/downloadAsImage.ts](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS50cw==) | `43.75% <43.75%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `79.16% <100.00%> (+9.60%)` | :arrow_up: |
| [superset/viz.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `71.91% <0.00%> (-0.10%)` | :arrow_down: |
| [...rontend/src/SqlLab/components/AceEditorWrapper.tsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL0FjZUVkaXRvcldyYXBwZXIudHN4) | `56.98% <0.00%> (+1.07%)` | :arrow_up: |
| [superset-frontend/src/components/EditableTitle.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRWRpdGFibGVUaXRsZS5qc3g=) | `81.69% <0.00%> (+1.40%)` | :arrow_up: |
| [...perset-frontend/src/components/CopyToClipboard.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvQ29weVRvQ2xpcGJvYXJkLmpzeA==) | `36.36% <0.00%> (+1.51%)` | :arrow_up: |
| [...hboard/components/resizable/ResizableContainer.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL3Jlc2l6YWJsZS9SZXNpemFibGVDb250YWluZXIuanN4) | `71.87% <0.00%> (+1.56%)` | :arrow_up: |
| [...ashboard/components/gridComponents/ChartHolder.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0NoYXJ0SG9sZGVyLmpzeA==) | `81.35% <0.00%> (+1.69%)` | :arrow_up: |
| ... and [140 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...c3edfe7](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] ChristianMurphy commented on a change in pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
ChristianMurphy commented on a change in pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#discussion_r426220830
##########
File path: superset-frontend/src/dashboard/util/downloadAsImage.ts
##########
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { MouseEvent, MouseEventHandler } from 'react';
+import domToImage from 'dom-to-image';
+import kebabCase from 'lodash/kebabCase';
+
+/**
+ * generate a consistent file stem from a description and date
+ *
+ * @param description title or description of content of file
+ * @param date date when file was generated
+ */
+export const generateFileStem = (description: string, date = new Date()) => {
+ return `${kebabCase(description)}-${date
+ .toISOString()
+ .replace(/[: ]/g, '-')}`;
+};
+
+/**
+ * Create an event handler for turning an element into an image
+ *
+ * @param selector css selector of the parent element which should be turned into image
+ * @param fileStem name of generated file, without extension
+ * @param backgroundColor background color to apply to screenshot document
+ */
+export const downloadAsImage = (
+ selector: string,
+ fileStem: string,
+ backgroundColor = '#f5f5f5',
+): MouseEventHandler => (event: MouseEvent) => {
+ const elementToPrint = event.currentTarget.closest(selector);
+
+ if (!elementToPrint) throw new Error('printable element not found');
+
+ domToImage
+ .toJpeg(elementToPrint, { quality: 0.95, bgcolor: backgroundColor })
+ .then(dataUrl => {
+ const link = document.createElement('a');
+ link.download = `${fileStem}.jpeg`;
Review comment:
updated
##########
File path: superset-frontend/src/dashboard/util/downloadAsImage.ts
##########
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { MouseEvent, MouseEventHandler } from 'react';
+import domToImage from 'dom-to-image';
+import kebabCase from 'lodash/kebabCase';
+
+/**
+ * generate a consistent file stem from a description and date
+ *
+ * @param description title or description of content of file
+ * @param date date when file was generated
+ */
+export const generateFileStem = (description: string, date = new Date()) => {
+ return `${kebabCase(description)}-${date
+ .toISOString()
+ .replace(/[: ]/g, '-')}`;
+};
+
+/**
+ * Create an event handler for turning an element into an image
+ *
+ * @param selector css selector of the parent element which should be turned into image
+ * @param fileStem name of generated file, without extension
+ * @param backgroundColor background color to apply to screenshot document
+ */
+export const downloadAsImage = (
+ selector: string,
+ fileStem: string,
+ backgroundColor = '#f5f5f5',
+): MouseEventHandler => (event: MouseEvent) => {
+ const elementToPrint = event.currentTarget.closest(selector);
+
+ if (!elementToPrint) throw new Error('printable element not found');
+
+ domToImage
+ .toJpeg(elementToPrint, { quality: 0.95, bgcolor: backgroundColor })
+ .then(dataUrl => {
+ const link = document.createElement('a');
+ link.download = `${fileStem}.jpeg`;
+ link.href = dataUrl;
+ link.click();
+ });
+};
+
+export default downloadAsImage;
Review comment:
updated
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to export dashboard as image (#6973)
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **decrease** coverage by `2.17%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
- Coverage 66.16% 63.99% -2.18%
==========================================
Files 585 534 -51
Lines 30427 29093 -1334
Branches 3152 2808 -344
==========================================
- Hits 20133 18617 -1516
- Misses 10113 10287 +174
- Partials 181 189 +8
```
| Flag | Coverage Δ | |
|---|---|---|
| #cypress | `52.79% <50.00%> (?)` | |
| #javascript | `?` | |
| #python | `71.02% <ø> (ø)` | |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...set-frontend/src/dashboard/util/downloadAsImage.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS5qcw==) | `41.66% <41.66%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `75.00% <100.00%> (+5.43%)` | :arrow_up: |
| [...uperset-frontend/src/dashboard/util/dnd-reorder.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2RuZC1yZW9yZGVyLmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...rset-frontend/src/dashboard/util/getEmptyLayout.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEVtcHR5TGF5b3V0Lmpz) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [.../src/dashboard/util/getFilterScopeFromNodesTree.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldEZpbHRlclNjb3BlRnJvbU5vZGVzVHJlZS5qcw==) | `0.00% <0.00%> (-93.19%)` | :arrow_down: |
| [.../src/dashboard/components/FilterIndicatorGroup.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0ZpbHRlckluZGljYXRvckdyb3VwLmpzeA==) | `11.76% <0.00%> (-88.24%)` | :arrow_down: |
| [...c/explore/components/controls/withVerification.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy93aXRoVmVyaWZpY2F0aW9uLmpzeA==) | `9.09% <0.00%> (-87.88%)` | :arrow_down: |
| [...src/dashboard/components/gridComponents/Header.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0hlYWRlci5qc3g=) | `10.52% <0.00%> (-86.85%)` | :arrow_down: |
| [...rc/dashboard/components/gridComponents/Divider.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL2dyaWRDb21wb25lbnRzL0RpdmlkZXIuanN4) | `13.33% <0.00%> (-86.67%)` | :arrow_down: |
| [...uperset-frontend/src/utils/getClientErrorObject.ts](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3V0aWxzL2dldENsaWVudEVycm9yT2JqZWN0LnRz) | `0.00% <0.00%> (-83.88%)` | :arrow_down: |
| ... and [273 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...004c207](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **decrease** coverage by `0.14%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
- Coverage 66.16% 66.01% -0.15%
==========================================
Files 585 586 +1
Lines 30427 30452 +25
Branches 3152 3158 +6
==========================================
- Hits 20133 20104 -29
- Misses 10113 10167 +54
Partials 181 181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `70.79% <ø> (-0.24%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...d/src/dashboard/components/SliceHeaderControls.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyQ29udHJvbHMuanN4) | `11.62% <ø> (ø)` | |
| [...set-frontend/src/dashboard/util/downloadAsImage.ts](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS50cw==) | `44.44% <44.44%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `70.83% <100.00%> (+1.26%)` | :arrow_up: |
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `58.92% <0.00%> (-21.43%)` | :arrow_down: |
| [superset/utils/cache.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `45.83% <0.00%> (-20.84%)` | :arrow_down: |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `78.26% <0.00%> (-13.05%)` | :arrow_down: |
| [superset/views/database/api.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvYXBpLnB5) | `83.90% <0.00%> (-3.45%)` | :arrow_down: |
| [superset/db\_engine\_specs/postgres.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3Bvc3RncmVzLnB5) | `97.29% <0.00%> (-2.71%)` | :arrow_down: |
| [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `83.77% <0.00%> (-2.36%)` | :arrow_down: |
| [superset/jinja\_context.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvamluamFfY29udGV4dC5weQ==) | `84.69% <0.00%> (-1.03%)` | :arrow_down: |
| ... and [5 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...b4b954e](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to export dashboard as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **decrease** coverage by `0.04%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
- Coverage 66.16% 66.12% -0.05%
==========================================
Files 585 586 +1
Lines 30427 30441 +14
Branches 3152 3156 +4
==========================================
- Hits 20133 20128 -5
- Misses 10113 10132 +19
Partials 181 181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `70.96% <ø> (-0.07%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...set-frontend/src/dashboard/util/downloadAsImage.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS5qcw==) | `41.66% <41.66%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `70.83% <100.00%> (+1.26%)` | :arrow_up: |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `78.26% <0.00%> (-13.05%)` | :arrow_down: |
| [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `85.25% <0.00%> (-0.89%)` | :arrow_down: |
| [superset/views/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `74.90% <0.00%> (-0.23%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...e0be306](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] etr2460 commented on a change in pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
etr2460 commented on a change in pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#discussion_r426219899
##########
File path: superset-frontend/src/dashboard/util/downloadAsImage.ts
##########
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { MouseEvent, MouseEventHandler } from 'react';
+import domToImage from 'dom-to-image';
+import kebabCase from 'lodash/kebabCase';
+
+/**
+ * generate a consistent file stem from a description and date
+ *
+ * @param description title or description of content of file
+ * @param date date when file was generated
+ */
+export const generateFileStem = (description: string, date = new Date()) => {
+ return `${kebabCase(description)}-${date
+ .toISOString()
+ .replace(/[: ]/g, '-')}`;
+};
+
+/**
+ * Create an event handler for turning an element into an image
+ *
+ * @param selector css selector of the parent element which should be turned into image
+ * @param fileStem name of generated file, without extension
+ * @param backgroundColor background color to apply to screenshot document
+ */
+export const downloadAsImage = (
+ selector: string,
+ fileStem: string,
+ backgroundColor = '#f5f5f5',
Review comment:
I'd just do something like `const GRAY_BACKGROUND_COLOR = "#F5F5F5";` at the top of this file and use it as the default argument here. I've mentioned this issue with less variables not being in JS in another PR too, so i think we'll probably pull them out soon and then do a refactor throughout all the code (and thus clean up the usage here too).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **decrease** coverage by `0.05%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
- Coverage 66.16% 66.11% -0.06%
==========================================
Files 585 586 +1
Lines 30427 30452 +25
Branches 3152 3158 +6
==========================================
Hits 20133 20133
- Misses 10113 10138 +25
Partials 181 181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `70.95% <ø> (-0.08%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...d/src/dashboard/components/SliceHeaderControls.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyQ29udHJvbHMuanN4) | `11.62% <ø> (ø)` | |
| [...set-frontend/src/dashboard/util/downloadAsImage.ts](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS50cw==) | `44.44% <44.44%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `70.83% <100.00%> (+1.26%)` | :arrow_up: |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `78.26% <0.00%> (-13.05%)` | :arrow_down: |
| [superset/models/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `85.25% <0.00%> (-0.89%)` | :arrow_down: |
| [superset/views/core.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvY29yZS5weQ==) | `74.90% <0.00%> (-0.23%)` | :arrow_down: |
| [superset/viz.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `71.91% <0.00%> (-0.10%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...b4b954e](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **increase** coverage by `4.78%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
+ Coverage 66.16% 70.95% +4.78%
==========================================
Files 585 184 -401
Lines 30427 17868 -12559
Branches 3152 0 -3152
==========================================
- Hits 20133 12678 -7455
+ Misses 10113 5190 -4923
+ Partials 181 0 -181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `?` | |
| #python | `70.95% <ø> (-0.08%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `63.33% <0.00%> (-10.01%)` | :arrow_down: |
| [superset/db\_engine\_specs/postgres.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3Bvc3RncmVzLnB5) | `97.29% <0.00%> (-2.71%)` | :arrow_down: |
| [superset/result\_set.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVzdWx0X3NldC5weQ==) | `96.63% <0.00%> (-1.69%)` | :arrow_down: |
| [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `87.80% <0.00%> (-0.77%)` | :arrow_down: |
| [superset/sql\_lab.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX2xhYi5weQ==) | `77.63% <0.00%> (-0.44%)` | :arrow_down: |
| [superset/viz.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `71.91% <0.00%> (-0.10%)` | :arrow_down: |
| [...end/src/dashboard/util/dashboardFiltersColorMap.js](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rhc2hib2FyZEZpbHRlcnNDb2xvck1hcC5qcw==) | | |
| [...end/src/SqlLab/components/RunQueryActionButton.tsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1J1blF1ZXJ5QWN0aW9uQnV0dG9uLnRzeA==) | | |
| [...erset-frontend/src/profile/components/UserInfo.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Byb2ZpbGUvY29tcG9uZW50cy9Vc2VySW5mby5qc3g=) | | |
| [...-frontend/src/SqlLab/components/HighlightedSql.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL0hpZ2hsaWdodGVkU3FsLmpzeA==) | | |
| ... and [395 more](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...245db4c](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] codecov-io edited a comment on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-629682732
# [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=h1) Report
> Merging [#9819](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ea9b7f2dc426cf912f8f5f2b749cc707c9af6964&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9819/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #9819 +/- ##
==========================================
- Coverage 66.16% 66.15% -0.02%
==========================================
Files 585 586 +1
Lines 30427 30450 +23
Branches 3152 3158 +6
==========================================
+ Hits 20133 20143 +10
- Misses 10113 10126 +13
Partials 181 181
```
| Flag | Coverage Δ | |
|---|---|---|
| #javascript | `59.24% <50.00%> (-0.02%)` | :arrow_down: |
| #python | `71.01% <ø> (-0.02%)` | :arrow_down: |
| [Impacted Files](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...d/src/dashboard/components/SliceHeaderControls.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyQ29udHJvbHMuanN4) | `11.62% <ø> (ø)` | |
| [...set-frontend/src/dashboard/util/downloadAsImage.ts](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2Rvd25sb2FkQXNJbWFnZS50cw==) | `43.75% <43.75%> (ø)` | |
| [...src/dashboard/components/HeaderActionsDropdown.jsx](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlckFjdGlvbnNEcm9wZG93bi5qc3g=) | `70.83% <100.00%> (+1.26%)` | :arrow_up: |
| [superset/db\_engine\_specs/postgres.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3Bvc3RncmVzLnB5) | `97.29% <0.00%> (-2.71%)` | :arrow_down: |
| [superset/viz.py](https://codecov.io/gh/apache/incubator-superset/pull/9819/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `71.91% <0.00%> (-0.10%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=footer). Last update [ea9b7f2...c3edfe7](https://codecov.io/gh/apache/incubator-superset/pull/9819?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] villebro commented on pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
villebro commented on pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#issuecomment-656036709
> Huge thanks to @ChristianMurphy! This is a feature users have been craving for. Can I ask if this will make it into 0.37?
Absolutely 😃 I'm going to try to cut `0.37` today, stay tuned.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] ChristianMurphy commented on a change in pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
ChristianMurphy commented on a change in pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#discussion_r426220820
##########
File path: superset-frontend/src/dashboard/util/downloadAsImage.ts
##########
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { MouseEvent, MouseEventHandler } from 'react';
+import domToImage from 'dom-to-image';
+import kebabCase from 'lodash/kebabCase';
+
+/**
+ * generate a consistent file stem from a description and date
+ *
+ * @param description title or description of content of file
+ * @param date date when file was generated
+ */
+export const generateFileStem = (description: string, date = new Date()) => {
+ return `${kebabCase(description)}-${date
+ .toISOString()
+ .replace(/[: ]/g, '-')}`;
+};
+
+/**
+ * Create an event handler for turning an element into an image
+ *
+ * @param selector css selector of the parent element which should be turned into image
+ * @param fileStem name of generated file, without extension
+ * @param backgroundColor background color to apply to screenshot document
+ */
+export const downloadAsImage = (
+ selector: string,
+ fileStem: string,
+ backgroundColor = '#f5f5f5',
+): MouseEventHandler => (event: MouseEvent) => {
+ const elementToPrint = event.currentTarget.closest(selector);
+
+ if (!elementToPrint) throw new Error('printable element not found');
Review comment:
thanks for the tip! incorporated a toast message
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] ChristianMurphy commented on a change in pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
ChristianMurphy commented on a change in pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#discussion_r426222082
##########
File path: superset-frontend/src/dashboard/util/downloadAsImage.ts
##########
@@ -0,0 +1,70 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { SyntheticEvent } from 'react';
+import domToImage from 'dom-to-image';
+import kebabCase from 'lodash/kebabCase';
+import { addWarningToast } from 'src/messageToasts/actions';
+
+/**
+ * @remark
+ * same as https://github.com/apache/incubator-superset/blob/c53bc4ddf9808a8bb6916bbe3cb31935d33a2420/superset-frontend/stylesheets/less/variables.less#L34
+ */
+const GRAY_BACKGROUND_COLOR = '#F5F5F5';
+
+/**
+ * generate a consistent file stem from a description and date
+ *
+ * @param description title or description of content of file
+ * @param date date when file was generated
+ */
+const generateFileStem = (description: string, date = new Date()) => {
+ return `${kebabCase(description)}-${date
+ .toISOString()
+ .replace(/[: ]/g, '-')}`;
+};
+
+/**
+ * Create an event handler for turning an element into an image
+ *
+ * @param selector css selector of the parent element which should be turned into image
+ * @param description name or a short description of what is being printed.
+ * Value will be normalized, and a date as well as a file extension will be added.
+ * @param backgroundColor background color to apply to screenshot document
+ * @returns event handler
+ */
+export default function downloadAsImage(
+ selector: string,
+ description: string,
+ backgroundColor = GRAY_BACKGROUND_COLOR,
+) {
+ return (event: SyntheticEvent) => {
+ const elementToPrint = event.currentTarget.closest(selector);
+
+ if (!elementToPrint) return addWarningToast('no element to print');
Review comment:
can do, updated
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [incubator-superset] ChristianMurphy commented on a change in pull request #9819: feat(frontend): add ability to download dashboard and chart as image
Posted by GitBox <gi...@apache.org>.
ChristianMurphy commented on a change in pull request #9819:
URL: https://github.com/apache/incubator-superset/pull/9819#discussion_r426220866
##########
File path: superset-frontend/src/dashboard/util/downloadAsImage.ts
##########
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { MouseEvent, MouseEventHandler } from 'react';
+import domToImage from 'dom-to-image';
+import kebabCase from 'lodash/kebabCase';
+
+/**
+ * generate a consistent file stem from a description and date
+ *
+ * @param description title or description of content of file
+ * @param date date when file was generated
+ */
+export const generateFileStem = (description: string, date = new Date()) => {
+ return `${kebabCase(description)}-${date
+ .toISOString()
+ .replace(/[: ]/g, '-')}`;
+};
+
+/**
+ * Create an event handler for turning an element into an image
+ *
+ * @param selector css selector of the parent element which should be turned into image
+ * @param fileStem name of generated file, without extension
+ * @param backgroundColor background color to apply to screenshot document
+ */
+export const downloadAsImage = (
Review comment:
updated
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org