ex4nicegui 0.7.0__tar.gz → 0.8.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/PKG-INFO +157 -118
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/README.md +155 -116
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/EChartsComponent/ECharts.js +2 -3
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/EChartsComponent/ECharts.py +2 -4
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/__init__.py +6 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/base.py +3 -1
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/mermaid/mermaid.py +2 -5
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/mixins/backgroundColor.py +1 -1
- ex4nicegui-0.8.0/ex4nicegui/reactive/mixins/flexLayout.py +51 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/mixins/textColor.py +1 -1
- ex4nicegui-0.8.0/ex4nicegui/reactive/mixins/value_element.py +27 -0
- ex4nicegui-0.8.0/ex4nicegui/reactive/officials/avatar.py +86 -0
- ex4nicegui-0.8.0/ex4nicegui/reactive/officials/badge.py +102 -0
- ex4nicegui-0.8.0/ex4nicegui/reactive/officials/card.py +89 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/checkbox.py +7 -12
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/chip.py +12 -3
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/circular_progress.py +7 -11
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/color_picker.py +4 -10
- ex4nicegui-0.8.0/ex4nicegui/reactive/officials/column.py +45 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/date.py +4 -11
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/dialog.py +4 -11
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/echarts.py +10 -8
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/expansion.py +4 -11
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/icon.py +2 -8
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/image.py +1 -1
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/input.py +13 -14
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/knob.py +4 -13
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/label.py +6 -4
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/linear_progress.py +6 -11
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/number.py +8 -12
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/radio.py +5 -13
- ex4nicegui-0.8.0/ex4nicegui/reactive/officials/row.py +42 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/select.py +2 -2
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/slider.py +4 -12
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/switch.py +5 -13
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/tab_panels.py +4 -8
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/tabs.py +4 -9
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/textarea.py +4 -10
- ex4nicegui-0.8.0/ex4nicegui/reactive/officials/toggle.py +88 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/tooltip.py +1 -1
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/systems/reactive_system.py +2 -2
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/view_model.py +4 -4
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/pyproject.toml +2 -2
- ex4nicegui-0.7.0/ex4nicegui/reactive/officials/card.py +0 -59
- ex4nicegui-0.7.0/ex4nicegui/reactive/officials/column.py +0 -37
- ex4nicegui-0.7.0/ex4nicegui/reactive/officials/row.py +0 -35
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/LICENSE +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/dataSource.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/dataSourceFacade.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/containers.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/layouts.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/models.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/text.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_aggrid.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_date_picker.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_date_picker.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_echarts.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_radio.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_range.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_select.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_slider.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_table.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/index.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/protocols.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/bi/types.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/experimental_/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/experimental_/gridLayout/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/experimental_/gridLayout/index.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/gsap/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/gsap/gsap.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/gsap/timeline.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/gsap/timeline.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/gsap/wrapGsap.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/helper/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/helper/client_instance_locker.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/layout/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/layout/gridFlex/GridFlex.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/layout/gridFlex/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/layout/gridFlex/gridFlex.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/layout/gridFlex/utils.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/layout/rxFlex/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/layout/rxFlex/index.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/layout/rxFlex/types.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-color.ems.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-dispatch.ems.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-drag.ems.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-ease.ems.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-interpolate.ems.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-selection.ems.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-timer.ems.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-transition.ems.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-zoom.ems.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/.DS_Store +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/CSSPlugin.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/CSSRulePlugin.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/CustomEase.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/Draggable.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/EasePack.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/EaselPlugin.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/Flip.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/MotionPathPlugin.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/Observer.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/PixiPlugin.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/ScrollToPlugin.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/ScrollTrigger.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/TextPlugin.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/all.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/gsap-core.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/gsap.mjs +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/utils/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/utils/matrix.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/utils/paths.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/utils/strings.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/EChartsComponent/events.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/EChartsComponent/types.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/EChartsComponent/utils.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/UseDraggable/UseDraggable.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/UseDraggable/UseDraggable.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/deferredTask.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/dropZone/dropZone.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/dropZone/dropZone.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/empty.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/empty.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/fileWatcher.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/local_file_picker.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/mermaid/mermaid.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/mixins/disableable.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/aggrid.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/base.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/button.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/drawer.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/element.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/grid.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/html.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/html.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/tab.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/tab_panel.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/table.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/upload.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/q_pagination.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/rxui.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/scopedStyle.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/scopedStyle.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/services/pandas_service.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/services/reactive_service.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/systems/color_system.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/systems/object_system.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/transitionGroup.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/transitionGroup.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/useMouse/UseMouse.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/useMouse/UseMouse.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/usePagination.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/vfor.js +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/vfor.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/reactive/vmodel.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/tools/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/tools/debug.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/utils/__init__.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/utils/apiEffect.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/utils/asyncComputed.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/utils/clientScope.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/utils/common.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/utils/effect.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/utils/refComputed.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/utils/refWrapper.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/utils/scheduler.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/utils/signals.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/utils/types.py +0 -0
- {ex4nicegui-0.7.0 → ex4nicegui-0.8.0}/ex4nicegui/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ex4nicegui
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary: Extension library based on nicegui, providing data responsive,BI functionality modules
|
|
5
5
|
Home-page: https://github.com/CrystalWindSnake/ex4nicegui
|
|
6
6
|
License: MIT
|
|
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Requires-Dist: executing (>=2.0.1,<3.0.0)
|
|
19
|
-
Requires-Dist: nicegui (>=
|
|
19
|
+
Requires-Dist: nicegui (>=2.0.0,<3.0.0)
|
|
20
20
|
Requires-Dist: signe (>=0.4.20,<0.5.0)
|
|
21
21
|
Project-URL: Repository, https://github.com/CrystalWindSnake/ex4nicegui
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
@@ -32,12 +32,16 @@ Description-Content-Type: text/markdown
|
|
|
32
32
|
- [教程](#教程)
|
|
33
33
|
- [安装](#-安装)
|
|
34
34
|
- [使用](#-使用)
|
|
35
|
-
- [
|
|
35
|
+
- [图表](#-图表)
|
|
36
36
|
- [BI 模块](#bi-模块)
|
|
37
37
|
|
|
38
38
|
对 [nicegui](https://github.com/zauberzeug/nicegui) 做的扩展库。内置响应式组件,完全实现数据响应式界面编程。
|
|
39
39
|
|
|
40
40
|
|
|
41
|
+

|
|
42
|
+
|
|
43
|
+
[查看更多示例](https://github.com/CrystalWindSnake/ex4nicegui-examples)
|
|
44
|
+
|
|
41
45
|
## 教程
|
|
42
46
|
[头条文章-秒杀官方实现,python界面库,去掉90%事件代码的nicegui](https://www.toutiao.com/item/7253786340574265860/)
|
|
43
47
|
|
|
@@ -59,10 +63,10 @@ pip install ex4nicegui -U
|
|
|
59
63
|
|
|
60
64
|
## 🦄 使用
|
|
61
65
|
|
|
66
|
+

|
|
62
67
|
```python
|
|
63
68
|
from nicegui import ui
|
|
64
|
-
from ex4nicegui import ref_computed, effect, to_ref
|
|
65
|
-
from ex4nicegui.reactive import rxui
|
|
69
|
+
from ex4nicegui import rxui, ref_computed, effect, to_ref
|
|
66
70
|
|
|
67
71
|
# 定义响应式数据
|
|
68
72
|
r_input = to_ref("")
|
|
@@ -73,127 +77,41 @@ rxui.label(r_input)
|
|
|
73
77
|
|
|
74
78
|
ui.run()
|
|
75
79
|
```
|
|
76
|
-

|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
### 提供 echarts 图表组件
|
|
80
|
-
|
|
81
|
-
```python
|
|
82
|
-
from nicegui import ui
|
|
83
|
-
from ex4nicegui import ref_computed, effect, to_ref
|
|
84
|
-
from ex4nicegui.reactive import rxui
|
|
85
|
-
|
|
86
|
-
r_input = to_ref("")
|
|
87
|
-
|
|
88
|
-
# ref_computed 创建只读响应式变量
|
|
89
|
-
# 函数中使用任意其他响应式变量,会自动关联
|
|
90
|
-
@ref_computed
|
|
91
|
-
def cp_echarts_opts():
|
|
92
|
-
return {
|
|
93
|
-
"title": {"text": r_input.value}, #字典中使用任意响应式变量,通过 .value 获取值
|
|
94
|
-
"xAxis": {
|
|
95
|
-
"type": "category",
|
|
96
|
-
"data": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
|
|
97
|
-
},
|
|
98
|
-
"yAxis": {"type": "value"},
|
|
99
|
-
"series": [
|
|
100
|
-
{
|
|
101
|
-
"data": [120, 200, 150, 80, 70, 110, 130],
|
|
102
|
-
"type": "bar",
|
|
103
|
-
"showBackground": True,
|
|
104
|
-
"backgroundStyle": {"color": "rgba(180, 180, 180, 0.2)"},
|
|
105
|
-
}
|
|
106
|
-
],
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
input = rxui.input("输入内容,图表标题会同步", value=r_input)
|
|
110
|
-
# 通过响应式组件对象的 element 属性,获取原生 nicegui 组件对象
|
|
111
|
-
input.element.classes("w-full")
|
|
112
|
-
|
|
113
|
-
rxui.echarts(cp_echarts_opts)
|
|
114
|
-
|
|
115
|
-
ui.run()
|
|
116
|
-
```
|
|
117
|
-

|
|
118
80
|
|
|
119
81
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
`on` 函数参数 `event_name` 以及 `query` 使用,查看[echarts 事件中文文档](https://echarts.apache.org/handbook/zh/concepts/event/)
|
|
82
|
+
---
|
|
123
83
|
|
|
84
|
+

|
|
124
85
|
|
|
125
|
-
以下例子绑定鼠标单击事件
|
|
126
86
|
```python
|
|
127
87
|
from nicegui import ui
|
|
128
|
-
from ex4nicegui
|
|
129
|
-
|
|
130
|
-
opts = {
|
|
131
|
-
"xAxis": {"type": "value", "boundaryGap": [0, 0.01]},
|
|
132
|
-
"yAxis": {
|
|
133
|
-
"type": "category",
|
|
134
|
-
"data": ["Brazil", "Indonesia", "USA", "India", "China", "World"],
|
|
135
|
-
},
|
|
136
|
-
"series": [
|
|
137
|
-
{
|
|
138
|
-
"name": "first",
|
|
139
|
-
"type": "bar",
|
|
140
|
-
"data": [18203, 23489, 29034, 104970, 131744, 630230],
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"name": "second",
|
|
144
|
-
"type": "bar",
|
|
145
|
-
"data": [19325, 23438, 31000, 121594, 134141, 681807],
|
|
146
|
-
},
|
|
147
|
-
],
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
bar = rxui.echarts(opts)
|
|
151
|
-
|
|
152
|
-
def on_click(e: rxui.echarts.EChartsMouseEventArguments):
|
|
153
|
-
ui.notify(f"on_click:{e.seriesName}:{e.name}:{e.value}")
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
bar.on("click", on_click)
|
|
157
|
-
```
|
|
88
|
+
from ex4nicegui import rxui, to_ref
|
|
158
89
|
|
|
90
|
+
ui.radio.default_props("inline")
|
|
159
91
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
92
|
+
# 定义视图数据
|
|
93
|
+
colors = ["red", "green", "blue", "yellow", "purple", "white"]
|
|
94
|
+
color = to_ref("blue")
|
|
95
|
+
bg_color = to_ref("red")
|
|
164
96
|
|
|
165
|
-
opts = {
|
|
166
|
-
"xAxis": {"type": "value", "boundaryGap": [0, 0.01]},
|
|
167
|
-
"yAxis": {
|
|
168
|
-
"type": "category",
|
|
169
|
-
"data": ["Brazil", "Indonesia", "USA", "India", "China", "World"],
|
|
170
|
-
},
|
|
171
|
-
"series": [
|
|
172
|
-
{
|
|
173
|
-
"name": "first",
|
|
174
|
-
"type": "bar",
|
|
175
|
-
"data": [18203, 23489, 29034, 104970, 131744, 630230],
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
"name": "second",
|
|
179
|
-
"type": "bar",
|
|
180
|
-
"data": [19325, 23438, 31000, 121594, 134141, 681807],
|
|
181
|
-
},
|
|
182
|
-
],
|
|
183
|
-
}
|
|
184
97
|
|
|
185
|
-
|
|
98
|
+
## 函数中通过访问 `ref` 或其他关联函数获取值,一切会自动同步更新
|
|
99
|
+
def bg_text():
|
|
100
|
+
return f"Current background color is {bg_color.value}"
|
|
186
101
|
|
|
187
|
-
def on_first_series_mouseover(e: rxui.echarts.EChartsMouseEventArguments):
|
|
188
|
-
ui.notify(f"on_first_series_mouseover:{e.seriesName}:{e.name}:{e.value}")
|
|
189
102
|
|
|
103
|
+
# 界面
|
|
190
104
|
|
|
191
|
-
|
|
105
|
+
with ui.row(align_items="center"):
|
|
106
|
+
rxui.radio(colors, value=color)
|
|
107
|
+
## 可以使用 lambda
|
|
108
|
+
rxui.label(lambda: f"Font color is {color.value}").bind_style({"color": color})
|
|
192
109
|
|
|
193
|
-
ui.
|
|
110
|
+
with ui.row(align_items="center"):
|
|
111
|
+
rxui.radio(colors, value=bg_color)
|
|
112
|
+
## 直接绑定函数
|
|
113
|
+
rxui.label(bg_text).bind_style({"background-color": bg_color})
|
|
194
114
|
```
|
|
195
|
-
---
|
|
196
|
-
|
|
197
115
|
|
|
198
116
|
|
|
199
117
|
## ViewModel
|
|
@@ -264,19 +182,18 @@ class Home(rxui.ViewModel):
|
|
|
264
182
|
通过 `number` 组件修改年龄,一切都会自动更新。
|
|
265
183
|
|
|
266
184
|
```python
|
|
185
|
+
from typing import List
|
|
267
186
|
from ex4nicegui import rxui, Ref
|
|
268
187
|
from itertools import count
|
|
188
|
+
from nicegui import ui
|
|
269
189
|
|
|
270
190
|
id_generator = count()
|
|
271
191
|
|
|
272
192
|
class Person(rxui.ViewModel):
|
|
273
|
-
name
|
|
274
|
-
age = rxui.var(0)
|
|
275
|
-
|
|
276
|
-
def __init__(self, name: str = "", age: int = 0):
|
|
193
|
+
def __init__(self, name: str, age: int):
|
|
277
194
|
super().__init__()
|
|
278
|
-
self.name
|
|
279
|
-
self.age
|
|
195
|
+
self.name = rxui.var(name)
|
|
196
|
+
self.age = rxui.var(age)
|
|
280
197
|
self.id = next(id_generator)
|
|
281
198
|
|
|
282
199
|
|
|
@@ -318,6 +235,7 @@ with ui.row():
|
|
|
318
235
|
rxui.input(value=person.name, placeholder="名字")
|
|
319
236
|
rxui.number(value=person.age, min=1, max=100, step=1, placeholder="年龄")
|
|
320
237
|
|
|
238
|
+
ui.run()
|
|
321
239
|
```
|
|
322
240
|
|
|
323
241
|
如果你觉得 `rxui.vfor` 代码过于复杂,可以使用 `effect_refreshable` 装饰器代替。
|
|
@@ -326,7 +244,7 @@ with ui.row():
|
|
|
326
244
|
from ex4nicegui import rxui, Ref,effect_refreshable
|
|
327
245
|
...
|
|
328
246
|
|
|
329
|
-
# 明确指定监控 home.persons
|
|
247
|
+
# 明确指定监控 home.persons 变化,可以避免意外刷新
|
|
330
248
|
@effect_refreshable.on(home.persons)
|
|
331
249
|
def _():
|
|
332
250
|
|
|
@@ -343,6 +261,127 @@ def _():
|
|
|
343
261
|
|
|
344
262
|
---
|
|
345
263
|
|
|
264
|
+
## 图表
|
|
265
|
+
|
|
266
|
+
### 提供 echarts 图表组件
|
|
267
|
+
|
|
268
|
+
```python
|
|
269
|
+
from nicegui import ui
|
|
270
|
+
from ex4nicegui import ref_computed, effect, to_ref
|
|
271
|
+
from ex4nicegui.reactive import rxui
|
|
272
|
+
|
|
273
|
+
r_input = to_ref("")
|
|
274
|
+
|
|
275
|
+
# ref_computed 创建只读响应式变量
|
|
276
|
+
# 函数中使用任意其他响应式变量,会自动关联
|
|
277
|
+
@ref_computed
|
|
278
|
+
def cp_echarts_opts():
|
|
279
|
+
return {
|
|
280
|
+
"title": {"text": r_input.value}, #字典中使用任意响应式变量,通过 .value 获取值
|
|
281
|
+
"xAxis": {
|
|
282
|
+
"type": "category",
|
|
283
|
+
"data": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
|
|
284
|
+
},
|
|
285
|
+
"yAxis": {"type": "value"},
|
|
286
|
+
"series": [
|
|
287
|
+
{
|
|
288
|
+
"data": [120, 200, 150, 80, 70, 110, 130],
|
|
289
|
+
"type": "bar",
|
|
290
|
+
"showBackground": True,
|
|
291
|
+
"backgroundStyle": {"color": "rgba(180, 180, 180, 0.2)"},
|
|
292
|
+
}
|
|
293
|
+
],
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
input = rxui.input("输入内容,图表标题会同步", value=r_input)
|
|
297
|
+
# 通过响应式组件对象的 element 属性,获取原生 nicegui 组件对象
|
|
298
|
+
input.element.classes("w-full")
|
|
299
|
+
|
|
300
|
+
rxui.echarts(cp_echarts_opts)
|
|
301
|
+
|
|
302
|
+
ui.run()
|
|
303
|
+
```
|
|
304
|
+

|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
### echarts 图表鼠标事件
|
|
308
|
+
|
|
309
|
+
`on` 函数参数 `event_name` 以及 `query` 使用,查看[echarts 事件中文文档](https://echarts.apache.org/handbook/zh/concepts/event/)
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
以下例子绑定鼠标单击事件
|
|
313
|
+
```python
|
|
314
|
+
from nicegui import ui
|
|
315
|
+
from ex4nicegui.reactive import rxui
|
|
316
|
+
|
|
317
|
+
opts = {
|
|
318
|
+
"xAxis": {"type": "value", "boundaryGap": [0, 0.01]},
|
|
319
|
+
"yAxis": {
|
|
320
|
+
"type": "category",
|
|
321
|
+
"data": ["Brazil", "Indonesia", "USA", "India", "China", "World"],
|
|
322
|
+
},
|
|
323
|
+
"series": [
|
|
324
|
+
{
|
|
325
|
+
"name": "first",
|
|
326
|
+
"type": "bar",
|
|
327
|
+
"data": [18203, 23489, 29034, 104970, 131744, 630230],
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"name": "second",
|
|
331
|
+
"type": "bar",
|
|
332
|
+
"data": [19325, 23438, 31000, 121594, 134141, 681807],
|
|
333
|
+
},
|
|
334
|
+
],
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
bar = rxui.echarts(opts)
|
|
338
|
+
|
|
339
|
+
def on_click(e: rxui.echarts.EChartsMouseEventArguments):
|
|
340
|
+
ui.notify(f"on_click:{e.seriesName}:{e.name}:{e.value}")
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
bar.on("click", on_click)
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
以下例子只针对指定系列触发鼠标划过事件
|
|
348
|
+
```python
|
|
349
|
+
from nicegui import ui
|
|
350
|
+
from ex4nicegui.reactive import rxui
|
|
351
|
+
|
|
352
|
+
opts = {
|
|
353
|
+
"xAxis": {"type": "value", "boundaryGap": [0, 0.01]},
|
|
354
|
+
"yAxis": {
|
|
355
|
+
"type": "category",
|
|
356
|
+
"data": ["Brazil", "Indonesia", "USA", "India", "China", "World"],
|
|
357
|
+
},
|
|
358
|
+
"series": [
|
|
359
|
+
{
|
|
360
|
+
"name": "first",
|
|
361
|
+
"type": "bar",
|
|
362
|
+
"data": [18203, 23489, 29034, 104970, 131744, 630230],
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"name": "second",
|
|
366
|
+
"type": "bar",
|
|
367
|
+
"data": [19325, 23438, 31000, 121594, 134141, 681807],
|
|
368
|
+
},
|
|
369
|
+
],
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
bar = rxui.echarts(opts)
|
|
373
|
+
|
|
374
|
+
def on_first_series_mouseover(e: rxui.echarts.EChartsMouseEventArguments):
|
|
375
|
+
ui.notify(f"on_first_series_mouseover:{e.seriesName}:{e.name}:{e.value}")
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
bar.on("mouseover", on_first_series_mouseover, query={"seriesName": "first"})
|
|
379
|
+
|
|
380
|
+
ui.run()
|
|
381
|
+
```
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
|
|
346
385
|
## 响应式
|
|
347
386
|
|
|
348
387
|
```python
|
|
@@ -9,12 +9,16 @@
|
|
|
9
9
|
- [教程](#教程)
|
|
10
10
|
- [安装](#-安装)
|
|
11
11
|
- [使用](#-使用)
|
|
12
|
-
- [
|
|
12
|
+
- [图表](#-图表)
|
|
13
13
|
- [BI 模块](#bi-模块)
|
|
14
14
|
|
|
15
15
|
对 [nicegui](https://github.com/zauberzeug/nicegui) 做的扩展库。内置响应式组件,完全实现数据响应式界面编程。
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
[查看更多示例](https://github.com/CrystalWindSnake/ex4nicegui-examples)
|
|
21
|
+
|
|
18
22
|
## 教程
|
|
19
23
|
[头条文章-秒杀官方实现,python界面库,去掉90%事件代码的nicegui](https://www.toutiao.com/item/7253786340574265860/)
|
|
20
24
|
|
|
@@ -36,10 +40,10 @@ pip install ex4nicegui -U
|
|
|
36
40
|
|
|
37
41
|
## 🦄 使用
|
|
38
42
|
|
|
43
|
+

|
|
39
44
|
```python
|
|
40
45
|
from nicegui import ui
|
|
41
|
-
from ex4nicegui import ref_computed, effect, to_ref
|
|
42
|
-
from ex4nicegui.reactive import rxui
|
|
46
|
+
from ex4nicegui import rxui, ref_computed, effect, to_ref
|
|
43
47
|
|
|
44
48
|
# 定义响应式数据
|
|
45
49
|
r_input = to_ref("")
|
|
@@ -50,127 +54,41 @@ rxui.label(r_input)
|
|
|
50
54
|
|
|
51
55
|
ui.run()
|
|
52
56
|
```
|
|
53
|
-

|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
### 提供 echarts 图表组件
|
|
57
|
-
|
|
58
|
-
```python
|
|
59
|
-
from nicegui import ui
|
|
60
|
-
from ex4nicegui import ref_computed, effect, to_ref
|
|
61
|
-
from ex4nicegui.reactive import rxui
|
|
62
|
-
|
|
63
|
-
r_input = to_ref("")
|
|
64
|
-
|
|
65
|
-
# ref_computed 创建只读响应式变量
|
|
66
|
-
# 函数中使用任意其他响应式变量,会自动关联
|
|
67
|
-
@ref_computed
|
|
68
|
-
def cp_echarts_opts():
|
|
69
|
-
return {
|
|
70
|
-
"title": {"text": r_input.value}, #字典中使用任意响应式变量,通过 .value 获取值
|
|
71
|
-
"xAxis": {
|
|
72
|
-
"type": "category",
|
|
73
|
-
"data": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
|
|
74
|
-
},
|
|
75
|
-
"yAxis": {"type": "value"},
|
|
76
|
-
"series": [
|
|
77
|
-
{
|
|
78
|
-
"data": [120, 200, 150, 80, 70, 110, 130],
|
|
79
|
-
"type": "bar",
|
|
80
|
-
"showBackground": True,
|
|
81
|
-
"backgroundStyle": {"color": "rgba(180, 180, 180, 0.2)"},
|
|
82
|
-
}
|
|
83
|
-
],
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
input = rxui.input("输入内容,图表标题会同步", value=r_input)
|
|
87
|
-
# 通过响应式组件对象的 element 属性,获取原生 nicegui 组件对象
|
|
88
|
-
input.element.classes("w-full")
|
|
89
|
-
|
|
90
|
-
rxui.echarts(cp_echarts_opts)
|
|
91
|
-
|
|
92
|
-
ui.run()
|
|
93
|
-
```
|
|
94
|
-

|
|
95
57
|
|
|
96
58
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
`on` 函数参数 `event_name` 以及 `query` 使用,查看[echarts 事件中文文档](https://echarts.apache.org/handbook/zh/concepts/event/)
|
|
59
|
+
---
|
|
100
60
|
|
|
61
|
+

|
|
101
62
|
|
|
102
|
-
以下例子绑定鼠标单击事件
|
|
103
63
|
```python
|
|
104
64
|
from nicegui import ui
|
|
105
|
-
from ex4nicegui
|
|
106
|
-
|
|
107
|
-
opts = {
|
|
108
|
-
"xAxis": {"type": "value", "boundaryGap": [0, 0.01]},
|
|
109
|
-
"yAxis": {
|
|
110
|
-
"type": "category",
|
|
111
|
-
"data": ["Brazil", "Indonesia", "USA", "India", "China", "World"],
|
|
112
|
-
},
|
|
113
|
-
"series": [
|
|
114
|
-
{
|
|
115
|
-
"name": "first",
|
|
116
|
-
"type": "bar",
|
|
117
|
-
"data": [18203, 23489, 29034, 104970, 131744, 630230],
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
"name": "second",
|
|
121
|
-
"type": "bar",
|
|
122
|
-
"data": [19325, 23438, 31000, 121594, 134141, 681807],
|
|
123
|
-
},
|
|
124
|
-
],
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
bar = rxui.echarts(opts)
|
|
128
|
-
|
|
129
|
-
def on_click(e: rxui.echarts.EChartsMouseEventArguments):
|
|
130
|
-
ui.notify(f"on_click:{e.seriesName}:{e.name}:{e.value}")
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
bar.on("click", on_click)
|
|
134
|
-
```
|
|
65
|
+
from ex4nicegui import rxui, to_ref
|
|
135
66
|
|
|
67
|
+
ui.radio.default_props("inline")
|
|
136
68
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
69
|
+
# 定义视图数据
|
|
70
|
+
colors = ["red", "green", "blue", "yellow", "purple", "white"]
|
|
71
|
+
color = to_ref("blue")
|
|
72
|
+
bg_color = to_ref("red")
|
|
141
73
|
|
|
142
|
-
opts = {
|
|
143
|
-
"xAxis": {"type": "value", "boundaryGap": [0, 0.01]},
|
|
144
|
-
"yAxis": {
|
|
145
|
-
"type": "category",
|
|
146
|
-
"data": ["Brazil", "Indonesia", "USA", "India", "China", "World"],
|
|
147
|
-
},
|
|
148
|
-
"series": [
|
|
149
|
-
{
|
|
150
|
-
"name": "first",
|
|
151
|
-
"type": "bar",
|
|
152
|
-
"data": [18203, 23489, 29034, 104970, 131744, 630230],
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"name": "second",
|
|
156
|
-
"type": "bar",
|
|
157
|
-
"data": [19325, 23438, 31000, 121594, 134141, 681807],
|
|
158
|
-
},
|
|
159
|
-
],
|
|
160
|
-
}
|
|
161
74
|
|
|
162
|
-
|
|
75
|
+
## 函数中通过访问 `ref` 或其他关联函数获取值,一切会自动同步更新
|
|
76
|
+
def bg_text():
|
|
77
|
+
return f"Current background color is {bg_color.value}"
|
|
163
78
|
|
|
164
|
-
def on_first_series_mouseover(e: rxui.echarts.EChartsMouseEventArguments):
|
|
165
|
-
ui.notify(f"on_first_series_mouseover:{e.seriesName}:{e.name}:{e.value}")
|
|
166
79
|
|
|
80
|
+
# 界面
|
|
167
81
|
|
|
168
|
-
|
|
82
|
+
with ui.row(align_items="center"):
|
|
83
|
+
rxui.radio(colors, value=color)
|
|
84
|
+
## 可以使用 lambda
|
|
85
|
+
rxui.label(lambda: f"Font color is {color.value}").bind_style({"color": color})
|
|
169
86
|
|
|
170
|
-
ui.
|
|
87
|
+
with ui.row(align_items="center"):
|
|
88
|
+
rxui.radio(colors, value=bg_color)
|
|
89
|
+
## 直接绑定函数
|
|
90
|
+
rxui.label(bg_text).bind_style({"background-color": bg_color})
|
|
171
91
|
```
|
|
172
|
-
---
|
|
173
|
-
|
|
174
92
|
|
|
175
93
|
|
|
176
94
|
## ViewModel
|
|
@@ -241,19 +159,18 @@ class Home(rxui.ViewModel):
|
|
|
241
159
|
通过 `number` 组件修改年龄,一切都会自动更新。
|
|
242
160
|
|
|
243
161
|
```python
|
|
162
|
+
from typing import List
|
|
244
163
|
from ex4nicegui import rxui, Ref
|
|
245
164
|
from itertools import count
|
|
165
|
+
from nicegui import ui
|
|
246
166
|
|
|
247
167
|
id_generator = count()
|
|
248
168
|
|
|
249
169
|
class Person(rxui.ViewModel):
|
|
250
|
-
name
|
|
251
|
-
age = rxui.var(0)
|
|
252
|
-
|
|
253
|
-
def __init__(self, name: str = "", age: int = 0):
|
|
170
|
+
def __init__(self, name: str, age: int):
|
|
254
171
|
super().__init__()
|
|
255
|
-
self.name
|
|
256
|
-
self.age
|
|
172
|
+
self.name = rxui.var(name)
|
|
173
|
+
self.age = rxui.var(age)
|
|
257
174
|
self.id = next(id_generator)
|
|
258
175
|
|
|
259
176
|
|
|
@@ -295,6 +212,7 @@ with ui.row():
|
|
|
295
212
|
rxui.input(value=person.name, placeholder="名字")
|
|
296
213
|
rxui.number(value=person.age, min=1, max=100, step=1, placeholder="年龄")
|
|
297
214
|
|
|
215
|
+
ui.run()
|
|
298
216
|
```
|
|
299
217
|
|
|
300
218
|
如果你觉得 `rxui.vfor` 代码过于复杂,可以使用 `effect_refreshable` 装饰器代替。
|
|
@@ -303,7 +221,7 @@ with ui.row():
|
|
|
303
221
|
from ex4nicegui import rxui, Ref,effect_refreshable
|
|
304
222
|
...
|
|
305
223
|
|
|
306
|
-
# 明确指定监控 home.persons
|
|
224
|
+
# 明确指定监控 home.persons 变化,可以避免意外刷新
|
|
307
225
|
@effect_refreshable.on(home.persons)
|
|
308
226
|
def _():
|
|
309
227
|
|
|
@@ -320,6 +238,127 @@ def _():
|
|
|
320
238
|
|
|
321
239
|
---
|
|
322
240
|
|
|
241
|
+
## 图表
|
|
242
|
+
|
|
243
|
+
### 提供 echarts 图表组件
|
|
244
|
+
|
|
245
|
+
```python
|
|
246
|
+
from nicegui import ui
|
|
247
|
+
from ex4nicegui import ref_computed, effect, to_ref
|
|
248
|
+
from ex4nicegui.reactive import rxui
|
|
249
|
+
|
|
250
|
+
r_input = to_ref("")
|
|
251
|
+
|
|
252
|
+
# ref_computed 创建只读响应式变量
|
|
253
|
+
# 函数中使用任意其他响应式变量,会自动关联
|
|
254
|
+
@ref_computed
|
|
255
|
+
def cp_echarts_opts():
|
|
256
|
+
return {
|
|
257
|
+
"title": {"text": r_input.value}, #字典中使用任意响应式变量,通过 .value 获取值
|
|
258
|
+
"xAxis": {
|
|
259
|
+
"type": "category",
|
|
260
|
+
"data": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
|
|
261
|
+
},
|
|
262
|
+
"yAxis": {"type": "value"},
|
|
263
|
+
"series": [
|
|
264
|
+
{
|
|
265
|
+
"data": [120, 200, 150, 80, 70, 110, 130],
|
|
266
|
+
"type": "bar",
|
|
267
|
+
"showBackground": True,
|
|
268
|
+
"backgroundStyle": {"color": "rgba(180, 180, 180, 0.2)"},
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
input = rxui.input("输入内容,图表标题会同步", value=r_input)
|
|
274
|
+
# 通过响应式组件对象的 element 属性,获取原生 nicegui 组件对象
|
|
275
|
+
input.element.classes("w-full")
|
|
276
|
+
|
|
277
|
+
rxui.echarts(cp_echarts_opts)
|
|
278
|
+
|
|
279
|
+
ui.run()
|
|
280
|
+
```
|
|
281
|
+

|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
### echarts 图表鼠标事件
|
|
285
|
+
|
|
286
|
+
`on` 函数参数 `event_name` 以及 `query` 使用,查看[echarts 事件中文文档](https://echarts.apache.org/handbook/zh/concepts/event/)
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
以下例子绑定鼠标单击事件
|
|
290
|
+
```python
|
|
291
|
+
from nicegui import ui
|
|
292
|
+
from ex4nicegui.reactive import rxui
|
|
293
|
+
|
|
294
|
+
opts = {
|
|
295
|
+
"xAxis": {"type": "value", "boundaryGap": [0, 0.01]},
|
|
296
|
+
"yAxis": {
|
|
297
|
+
"type": "category",
|
|
298
|
+
"data": ["Brazil", "Indonesia", "USA", "India", "China", "World"],
|
|
299
|
+
},
|
|
300
|
+
"series": [
|
|
301
|
+
{
|
|
302
|
+
"name": "first",
|
|
303
|
+
"type": "bar",
|
|
304
|
+
"data": [18203, 23489, 29034, 104970, 131744, 630230],
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"name": "second",
|
|
308
|
+
"type": "bar",
|
|
309
|
+
"data": [19325, 23438, 31000, 121594, 134141, 681807],
|
|
310
|
+
},
|
|
311
|
+
],
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
bar = rxui.echarts(opts)
|
|
315
|
+
|
|
316
|
+
def on_click(e: rxui.echarts.EChartsMouseEventArguments):
|
|
317
|
+
ui.notify(f"on_click:{e.seriesName}:{e.name}:{e.value}")
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
bar.on("click", on_click)
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
以下例子只针对指定系列触发鼠标划过事件
|
|
325
|
+
```python
|
|
326
|
+
from nicegui import ui
|
|
327
|
+
from ex4nicegui.reactive import rxui
|
|
328
|
+
|
|
329
|
+
opts = {
|
|
330
|
+
"xAxis": {"type": "value", "boundaryGap": [0, 0.01]},
|
|
331
|
+
"yAxis": {
|
|
332
|
+
"type": "category",
|
|
333
|
+
"data": ["Brazil", "Indonesia", "USA", "India", "China", "World"],
|
|
334
|
+
},
|
|
335
|
+
"series": [
|
|
336
|
+
{
|
|
337
|
+
"name": "first",
|
|
338
|
+
"type": "bar",
|
|
339
|
+
"data": [18203, 23489, 29034, 104970, 131744, 630230],
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"name": "second",
|
|
343
|
+
"type": "bar",
|
|
344
|
+
"data": [19325, 23438, 31000, 121594, 134141, 681807],
|
|
345
|
+
},
|
|
346
|
+
],
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
bar = rxui.echarts(opts)
|
|
350
|
+
|
|
351
|
+
def on_first_series_mouseover(e: rxui.echarts.EChartsMouseEventArguments):
|
|
352
|
+
ui.notify(f"on_first_series_mouseover:{e.seriesName}:{e.name}:{e.value}")
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
bar.on("mouseover", on_first_series_mouseover, query={"seriesName": "first"})
|
|
356
|
+
|
|
357
|
+
ui.run()
|
|
358
|
+
```
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
|
|
323
362
|
## 响应式
|
|
324
363
|
|
|
325
364
|
```python
|