Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metric format converter #1321

Merged
merged 23 commits into from
Jun 4, 2024
Merged

Metric format converter #1321

merged 23 commits into from
Jun 4, 2024

Conversation

namnguyen20999
Copy link
Member

Adding custom converter to convert sprintf-js to d3format for plotly:

default_value = 50.5

max_value = 100
min_value = 0

format_type = '%.1f%%'
format_delta = '%.1f$'

page = """
# Extension library
<|{default_value}|metric|show_value=True|delta=20.5|format_delta={format_delta}|format={format_type}|>
<|{default_value}|slider|min=0|step=0.5|>
"""

image

Copy link
Contributor

github-actions bot commented May 26, 2024

Coverage report for frontend/taipy-gui

Branches coverage not met for global: expected >=80%, but got 62.22462983026363%

St.
Category Percentage Covered / Total
🟢 Statements
80.9% (-0.57% 🔻)
2728/3372
🟡 Branches
62.22% (-1.29% 🔻)
1723/2769
🟡 Functions
74.42% (-0.66% 🔻)
483/649
🟢 Lines
81.44% (-0.57% 🔻)
2537/3115
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / Dialog.tsx
80.43% 60.87% 100% 80.43%
🟡
... / TaipyRendered.tsx
64.58% 14.29% 50% 64.58%
🟡
... / index.ts
75% 26.67% 50% 74.47%
🟢
... / Expandable.tsx
100% 85% 100% 100%
🔴
... / formatConversion.ts
44.9% 11.76% 44.44% 41.46%
🟢
... / PageContent.tsx
75% 100% 0% 100%
🟢
... / Pane.tsx
95.12% 73.81% 100% 94.87%
🟢
... / Part.tsx
88% 64.29% 75% 91.3%
🟡
... / Unregistered.tsx
62.5% 0% 0% 60%

Test suite run success

386 tests passing in 40 suites.

Report generated by 🧪jest coverage report action from 4436b1a

Copy link
Contributor

github-actions bot commented May 26, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
18436 16129 87% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
taipy/gui/_renderers/factory.py 96% 🟢
TOTAL 96% 🟢

updated for commit: 4436b1a by action🐍

Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor little things...

taipy/gui/_renderers/factory.py Outdated Show resolved Hide resolved
frontend/taipy-gui/src/components/Taipy/Metric.tsx Outdated Show resolved Hide resolved
frontend/taipy-gui/src/components/Taipy/Metric.tsx Outdated Show resolved Hide resolved
frontend/taipy-gui/src/components/Taipy/Metric.tsx Outdated Show resolved Hide resolved
frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
@FabienLelaquais FabienLelaquais self-requested a review May 29, 2024 07:50
FredLL-Avaiga
FredLL-Avaiga previously approved these changes May 31, 2024
Copy link
Member

@FredLL-Avaiga FredLL-Avaiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

frontend/taipy-gui/src/components/Taipy/Metric.tsx Outdated Show resolved Hide resolved
frontend/taipy-gui/src/components/Taipy/Metric.tsx Outdated Show resolved Hide resolved
frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
pytest.ini Outdated Show resolved Hide resolved
taipy/gui/viselements.json Outdated Show resolved Hide resolved
FabienLelaquais
FabienLelaquais previously approved these changes Jun 2, 2024
Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor comments, not related to the feature.
Well done!

frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
taipy/gui/viselements.json Outdated Show resolved Hide resolved
frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
taipy/gui/viselements.json Outdated Show resolved Hide resolved
FredLL-Avaiga
FredLL-Avaiga previously approved these changes Jun 3, 2024
frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
FredLL-Avaiga
FredLL-Avaiga previously approved these changes Jun 4, 2024
frontend/taipy-gui/src/components/Taipy/Metric.tsx Outdated Show resolved Hide resolved
frontend/taipy-gui/src/components/Taipy/Metric.tsx Outdated Show resolved Hide resolved
frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
frontend/taipy-gui/src/utils/formatConversion.ts Outdated Show resolved Hide resolved
Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@namnguyen20999 namnguyen20999 merged commit 9d68463 into develop Jun 4, 2024
155 checks passed
@namnguyen20999 namnguyen20999 deleted the 1297-value-format branch July 1, 2024 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants