You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "rfellows (via GitHub)" <gi...@apache.org> on 2025/07/29 17:22:56 UTC
[PR] NIFI-14800 - Shorten y-axis integer labels when 100,000 or more using standard abbreviations [nifi]
rfellows opened a new pull request, #10148:
URL: https://github.com/apache/nifi/pull/10148
<!-- 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. -->
# Summary
[NIFI-14800](https://issues.apache.org/jira/browse/NIFI-14800)
### Changes Made:
**1. Enhanced `formatInteger` method in `NiFiCommon` service:**
- **Purpose:** Solve y-axis label clipping issues in charts when displaying large numbers
- **Implementation:**
- Numbers ≥ 100,000 now use compact notation via `Intl.NumberFormat` with `notation: 'compact'`
- Shows up to 2 decimal places for precision (`maximumFractionDigits: 2`)
- Numbers < 100,000 continue using existing comma formatting
- Examples: `100000` → `"100K"`, `1250000` → `"1.25M"`, `2750000000` → `"2.75B"`
**2. Comprehensive test coverage:**
- **Added:** new test cases covering:
- Small numbers with comma formatting (0 to 99,999)
- Large numbers with compact notation (≥ 100,000)
- Negative number handling
- Edge cases around the 100,000 threshold
- Very large numbers (billions, trillions)
### Impact:
This change directly addresses chart label clipping issues by making large integer labels significantly shorter while maintaining readability. The status history chart component will automatically benefit from this improvement since it uses the `formatInteger` method through its formatters.
#### Before (labels aren't quite long enough to force clipping, but big enough to convey the idea)
<img width="895" height="741" alt="Screenshot 2025-07-29 at 13 17 23" src="https://github.com/user-attachments/assets/b04df586-e7f1-482f-8295-5b488fb2238a" />
#### After abbreviating the y axis labels
<img width="897" height="740" alt="Screenshot 2025-07-29 at 13 17 14" src="https://github.com/user-attachments/assets/7c8906bf-7cd1-4c1f-87bc-a0a025e9624c" />
--
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.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14800 - Shorten y-axis integer labels when 100,000 or more using standard abbreviations [nifi]
Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 commented on PR #10148:
URL: https://github.com/apache/nifi/pull/10148#issuecomment-3136604948
The abbreviation seems to also be used for Min/Max/Mean on the left side as well, not just the y-axis. Is that expected? We may want the exact number display there?
--
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.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14800 - Shorten y-axis integer labels when 100,000 or more using standard abbreviations [nifi]
Posted by "rfellows (via GitHub)" <gi...@apache.org>.
rfellows commented on PR #10148:
URL: https://github.com/apache/nifi/pull/10148#issuecomment-3136742094
> Abbreviation on the graph on the right - perfect. Abbreviation on the numbers on the left - please avoid if possible.
>
> I am constantly copying/pasting the real specific numbers from the left.
Thanks for the feedback @sfc-gh-jwitt and @pvillard31, I'll take it into account and update this PR.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14800 - Shorten y-axis integer labels when 100,000 or more using standard abbreviations [nifi]
Posted by "rfellows (via GitHub)" <gi...@apache.org>.
rfellows commented on PR #10148:
URL: https://github.com/apache/nifi/pull/10148#issuecomment-3136661302
> The abbreviation seems to also be used for Min/Max/Mean on the left side as well, not just the y-axis. Is that expected? We may want the exact number display there?
Maybe not explicitly intended. They use the same formatting function that is modified in this PR. I am not certain that the exact number is required here, but can see the argument for it. They are only shortened/abbreviated if the number is 6 digits or more (so 100,000+). If you think the use case for the exact number is common, I can see about leaving it the full number.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14800 - Shorten y-axis integer labels when 100,000 or more using standard abbreviations [nifi]
Posted by "sfc-gh-jwitt (via GitHub)" <gi...@apache.org>.
sfc-gh-jwitt commented on PR #10148:
URL: https://github.com/apache/nifi/pull/10148#issuecomment-3136723869
Abbreviation on the graph on the right - perfect.
Abbreviation on the numbers on the left - please avoid if possible.
I am constantly copying/pasting the real specific numbers from the left.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14800 - Shorten y-axis integer labels when 100,000 or more using standard abbreviations [nifi]
Posted by "scottyaslan (via GitHub)" <gi...@apache.org>.
scottyaslan commented on PR #10148:
URL: https://github.com/apache/nifi/pull/10148#issuecomment-3138163125
Reviewing...
--
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.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-14800 - Shorten y-axis integer labels when 100,000 or more using standard abbreviations [nifi]
Posted by "scottyaslan (via GitHub)" <gi...@apache.org>.
scottyaslan merged PR #10148:
URL: https://github.com/apache/nifi/pull/10148
--
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.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org