rusackas commented on a change in pull request #9525: Migrating shared NVD3 
controls to new module
URL: 
https://github.com/apache/incubator-superset/pull/9525#discussion_r409269108
 
 

 ##########
 File path: superset-frontend/src/explore/controlPanels/TimePivot.js
 ##########
 @@ -17,47 +17,96 @@
  * under the License.
  */
 import { t } from '@superset-ui/translation';
-import { D3_TIME_FORMAT_OPTIONS } from '../controls';
+import { D3_FORMAT_OPTIONS } from '../controls';
+import {
+  lineInterpolation,
+  showLegend,
+  xAxisLabel,
+  bottomMargin,
+  xAxisFormat,
+  yLogScale,
+  yAxisBounds,
+  xAxisShowMinmax,
+  yAxisShowMinmax,
+  yAxisLabel,
+  leftMargin,
+} from './Shared_NVD3';
 
 export default {
   requiresTime: true,
   controlPanelSections: [
     {
       label: t('Query'),
       expanded: true,
-      controlSetRows: [['metric'], ['adhoc_filters'], ['freq']],
+      controlSetRows: [
+        ['metric'],
+        ['adhoc_filters'],
+        [
+          {
+            name: 'freq',
+            config: {
+              type: 'SelectControl',
+              label: t('Frequency'),
+              default: 'W-MON',
+              freeForm: true,
+              clearable: false,
+              choices: [
+                ['AS', 'Year (freq=AS)'],
+                ['52W-MON', '52 weeks starting Monday (freq=52W-MON)'],
+                ['W-SUN', '1 week starting Sunday (freq=W-SUN)'],
+                ['W-MON', '1 week starting Monday (freq=W-MON)'],
+                ['D', 'Day (freq=D)'],
+                ['4W-MON', '4 weeks (freq=4W-MON)'],
+              ],
+              description: t(
+                `The periodicity over which to pivot time. Users can provide
+            "Pandas" offset alias.
+            Click on the info bubble for more details on accepted "freq" 
expressions.`,
+              ),
+              tooltipOnClick: () => {
+                window.open(
+                  
'https://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases',
+                );
+              },
+            },
+          },
+        ],
+      ],
     },
     {
       label: t('Chart Options'),
       expanded: true,
       controlSetRows: [
-        ['show_legend', 'line_interpolation'],
+        [showLegend, lineInterpolation],
         ['color_picker', null],
       ],
     },
     {
       label: t('X Axis'),
       expanded: true,
       controlSetRows: [
-        ['x_axis_label', 'bottom_margin'],
-        ['x_axis_showminmax', 'x_axis_format'],
+        [xAxisLabel, bottomMargin],
+        [
+          xAxisShowMinmax,
+          {
+            ...xAxisFormat,
 
 Review comment:
   Same goof here... will fix 😧

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to