From commits-return-2135-archive-asf-public=cust-asf.ponee.io@superset.incubator.apache.org Sat Jan 19 02:24:49 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 94AD1180647 for ; Sat, 19 Jan 2019 02:24:48 +0100 (CET) Received: (qmail 95608 invoked by uid 500); 19 Jan 2019 01:24:47 -0000 Mailing-List: contact commits-help@superset.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@superset.incubator.apache.org Delivered-To: mailing list commits@superset.incubator.apache.org Received: (qmail 95599 invoked by uid 99); 19 Jan 2019 01:24:47 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Jan 2019 01:24:47 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 31AEF87642; Sat, 19 Jan 2019 01:24:47 +0000 (UTC) Date: Sat, 19 Jan 2019 01:24:46 +0000 To: "commits@superset.apache.org" Subject: [incubator-superset] branch master updated: Revert "Truncate long labels (#6631)" (#6723) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <154786108679.19055.12998450571124513404@gitbox.apache.org> From: maximebeauchemin@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-superset X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: ef79757973744fc7461ee0c2709546544ba591df X-Git-Newrev: 057c43c56d9adc22a398d98cd08c4213051fa2c7 X-Git-Rev: 057c43c56d9adc22a398d98cd08c4213051fa2c7 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. maximebeauchemin pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-superset.git The following commit(s) were added to refs/heads/master by this push: new 057c43c Revert "Truncate long labels (#6631)" (#6723) 057c43c is described below commit 057c43c56d9adc22a398d98cd08c4213051fa2c7 Author: Maxime Beauchemin AuthorDate: Fri Jan 18 17:24:40 2019 -0800 Revert "Truncate long labels (#6631)" (#6723) This reverts commit 5055157b64e93f716cf1b93730cd0eb9a6dd010e. --- superset/assets/src/visualizations/nvd3/NVD3Vis.js | 6 ------ superset/assets/src/visualizations/nvd3/utils.js | 8 -------- 2 files changed, 14 deletions(-) diff --git a/superset/assets/src/visualizations/nvd3/NVD3Vis.js b/superset/assets/src/visualizations/nvd3/NVD3Vis.js index 345c93d..d2c3ea6 100644 --- a/superset/assets/src/visualizations/nvd3/NVD3Vis.js +++ b/superset/assets/src/visualizations/nvd3/NVD3Vis.js @@ -44,7 +44,6 @@ import { tryNumify, setAxisShowMaxMin, stringifyTimeRange, - truncateLabel, wrapTooltip, } from './utils'; import { @@ -627,8 +626,6 @@ function nvd3Vis(element, props) { if (chart.xAxis) { margins.bottom = 28; } - // truncate labels that are too long - d3.selectAll('.nv-x.nv-axis .tick text').text(truncateLabel); const maxYAxisLabelWidth = getMaxLabelSize(svg, chart.yAxis2 ? 'nv-y1' : 'nv-y'); const maxXAxisLabelHeight = getMaxLabelSize(svg, 'nv-x'); margins.left = maxYAxisLabelWidth + marginPad; @@ -714,9 +711,6 @@ function nvd3Vis(element, props) { .attr('height', height) .call(chart); - // truncate labels that are too long - d3.selectAll('.nv-x.nv-axis .tick text').text(truncateLabel); - // on scroll, hide tooltips. throttle to only 4x/second. window.addEventListener('scroll', throttle(hideTooltips, 250)); diff --git a/superset/assets/src/visualizations/nvd3/utils.js b/superset/assets/src/visualizations/nvd3/utils.js index 531e23f..715b19e 100644 --- a/superset/assets/src/visualizations/nvd3/utils.js +++ b/superset/assets/src/visualizations/nvd3/utils.js @@ -22,8 +22,6 @@ import dompurify from 'dompurify'; import { getNumberFormatter } from '@superset-ui/number-format'; import { smartDateFormatter } from '@superset-ui/time-format'; -const MAX_LABEL_LENGTH = 24; - // Regexp for the label added to time shifted series // (1 hour offset, 2 days offset, etc.) const TIME_SHIFT_PATTERN = /\d+ \w+ offset/; @@ -257,9 +255,3 @@ export function setAxisShowMaxMin(axis, showminmax) { axis.showMaxMin(showminmax); } } - -export function truncateLabel(text) { - return text.length > MAX_LABEL_LENGTH - ? text.substr(0, MAX_LABEL_LENGTH - 1) + '…' - : text; -}