ex4nicegui 0.7.1__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.1 → ex4nicegui-0.8.0}/PKG-INFO +153 -118
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/README.md +151 -116
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/EChartsComponent/ECharts.js +2 -3
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/EChartsComponent/ECharts.py +2 -4
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/mermaid/mermaid.py +2 -5
- ex4nicegui-0.8.0/ex4nicegui/reactive/mixins/flexLayout.py +51 -0
- ex4nicegui-0.8.0/ex4nicegui/reactive/mixins/value_element.py +27 -0
- ex4nicegui-0.8.0/ex4nicegui/reactive/officials/card.py +89 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/checkbox.py +7 -11
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/chip.py +11 -1
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/circular_progress.py +7 -11
- {ex4nicegui-0.7.1 → 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.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/date.py +4 -11
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/dialog.py +4 -11
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/echarts.py +9 -7
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/expansion.py +4 -11
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/input.py +12 -12
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/knob.py +4 -13
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/linear_progress.py +6 -11
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/number.py +7 -11
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/radio.py +4 -12
- ex4nicegui-0.8.0/ex4nicegui/reactive/officials/row.py +42 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/slider.py +4 -12
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/switch.py +5 -12
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/tab_panels.py +4 -8
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/tabs.py +4 -9
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/textarea.py +4 -10
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/pyproject.toml +2 -2
- ex4nicegui-0.7.1/ex4nicegui/reactive/officials/card.py +0 -59
- ex4nicegui-0.7.1/ex4nicegui/reactive/officials/column.py +0 -37
- ex4nicegui-0.7.1/ex4nicegui/reactive/officials/row.py +0 -35
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/LICENSE +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/dataSource.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/dataSourceFacade.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/containers.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/layouts.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/models.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/text.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_aggrid.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_date_picker.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_date_picker.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_echarts.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_radio.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_range.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_select.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_slider.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/elements/ui_table.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/index.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/protocols.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/bi/types.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/experimental_/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/experimental_/gridLayout/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/experimental_/gridLayout/index.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/gsap/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/gsap/gsap.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/gsap/timeline.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/gsap/timeline.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/gsap/wrapGsap.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/helper/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/helper/client_instance_locker.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/layout/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/layout/gridFlex/GridFlex.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/layout/gridFlex/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/layout/gridFlex/gridFlex.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/layout/gridFlex/utils.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/layout/rxFlex/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/layout/rxFlex/index.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/layout/rxFlex/types.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-color.ems.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-dispatch.ems.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-drag.ems.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-ease.ems.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-interpolate.ems.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-selection.ems.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-timer.ems.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-transition.ems.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/d3/d3-zoom.ems.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/.DS_Store +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/CSSPlugin.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/CSSRulePlugin.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/CustomEase.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/Draggable.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/EasePack.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/EaselPlugin.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/Flip.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/MotionPathPlugin.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/Observer.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/PixiPlugin.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/ScrollToPlugin.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/ScrollTrigger.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/TextPlugin.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/all.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/gsap-core.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/gsap.mjs +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/utils/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/utils/matrix.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/utils/paths.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/libs/gsap/utils/strings.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/EChartsComponent/events.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/EChartsComponent/types.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/EChartsComponent/utils.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/UseDraggable/UseDraggable.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/UseDraggable/UseDraggable.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/base.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/deferredTask.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/dropZone/dropZone.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/dropZone/dropZone.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/empty.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/empty.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/fileWatcher.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/local_file_picker.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/mermaid/mermaid.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/mixins/backgroundColor.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/mixins/disableable.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/mixins/textColor.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/aggrid.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/avatar.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/badge.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/base.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/button.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/drawer.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/element.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/grid.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/html.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/html.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/icon.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/image.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/label.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/select.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/tab.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/tab_panel.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/table.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/toggle.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/tooltip.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/officials/upload.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/q_pagination.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/rxui.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/scopedStyle.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/scopedStyle.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/services/pandas_service.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/services/reactive_service.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/systems/color_system.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/systems/object_system.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/systems/reactive_system.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/transitionGroup.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/transitionGroup.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/useMouse/UseMouse.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/useMouse/UseMouse.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/usePagination.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/vfor.js +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/vfor.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/view_model.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/reactive/vmodel.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/tools/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/tools/debug.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/utils/__init__.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/utils/apiEffect.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/utils/asyncComputed.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/utils/clientScope.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/utils/common.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/utils/effect.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/utils/refComputed.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/utils/refWrapper.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/utils/scheduler.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/utils/signals.py +0 -0
- {ex4nicegui-0.7.1 → ex4nicegui-0.8.0}/ex4nicegui/utils/types.py +0 -0
- {ex4nicegui-0.7.1 → 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,7 +32,7 @@ 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) 做的扩展库。内置响应式组件,完全实现数据响应式界面编程。
|
|
@@ -63,10 +63,10 @@ pip install ex4nicegui -U
|
|
|
63
63
|
|
|
64
64
|
## 🦄 使用
|
|
65
65
|
|
|
66
|
+

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

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

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

|
|
128
85
|
|
|
129
|
-
以下例子绑定鼠标单击事件
|
|
130
86
|
```python
|
|
131
87
|
from nicegui import ui
|
|
132
|
-
from ex4nicegui
|
|
133
|
-
|
|
134
|
-
opts = {
|
|
135
|
-
"xAxis": {"type": "value", "boundaryGap": [0, 0.01]},
|
|
136
|
-
"yAxis": {
|
|
137
|
-
"type": "category",
|
|
138
|
-
"data": ["Brazil", "Indonesia", "USA", "India", "China", "World"],
|
|
139
|
-
},
|
|
140
|
-
"series": [
|
|
141
|
-
{
|
|
142
|
-
"name": "first",
|
|
143
|
-
"type": "bar",
|
|
144
|
-
"data": [18203, 23489, 29034, 104970, 131744, 630230],
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"name": "second",
|
|
148
|
-
"type": "bar",
|
|
149
|
-
"data": [19325, 23438, 31000, 121594, 134141, 681807],
|
|
150
|
-
},
|
|
151
|
-
],
|
|
152
|
-
}
|
|
88
|
+
from ex4nicegui import rxui, to_ref
|
|
153
89
|
|
|
154
|
-
|
|
90
|
+
ui.radio.default_props("inline")
|
|
155
91
|
|
|
156
|
-
|
|
157
|
-
|
|
92
|
+
# 定义视图数据
|
|
93
|
+
colors = ["red", "green", "blue", "yellow", "purple", "white"]
|
|
94
|
+
color = to_ref("blue")
|
|
95
|
+
bg_color = to_ref("red")
|
|
158
96
|
|
|
159
97
|
|
|
160
|
-
|
|
161
|
-
|
|
98
|
+
## 函数中通过访问 `ref` 或其他关联函数获取值,一切会自动同步更新
|
|
99
|
+
def bg_text():
|
|
100
|
+
return f"Current background color is {bg_color.value}"
|
|
162
101
|
|
|
163
102
|
|
|
164
|
-
|
|
165
|
-
```python
|
|
166
|
-
from nicegui import ui
|
|
167
|
-
from ex4nicegui.reactive import rxui
|
|
103
|
+
# 界面
|
|
168
104
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
"data": ["Brazil", "Indonesia", "USA", "India", "China", "World"],
|
|
174
|
-
},
|
|
175
|
-
"series": [
|
|
176
|
-
{
|
|
177
|
-
"name": "first",
|
|
178
|
-
"type": "bar",
|
|
179
|
-
"data": [18203, 23489, 29034, 104970, 131744, 630230],
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
"name": "second",
|
|
183
|
-
"type": "bar",
|
|
184
|
-
"data": [19325, 23438, 31000, 121594, 134141, 681807],
|
|
185
|
-
},
|
|
186
|
-
],
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
bar = rxui.echarts(opts)
|
|
190
|
-
|
|
191
|
-
def on_first_series_mouseover(e: rxui.echarts.EChartsMouseEventArguments):
|
|
192
|
-
ui.notify(f"on_first_series_mouseover:{e.seriesName}:{e.name}:{e.value}")
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
bar.on("mouseover", on_first_series_mouseover, query={"seriesName": "first"})
|
|
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})
|
|
196
109
|
|
|
197
|
-
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})
|
|
198
114
|
```
|
|
199
|
-
---
|
|
200
|
-
|
|
201
115
|
|
|
202
116
|
|
|
203
117
|
## ViewModel
|
|
@@ -268,19 +182,18 @@ class Home(rxui.ViewModel):
|
|
|
268
182
|
通过 `number` 组件修改年龄,一切都会自动更新。
|
|
269
183
|
|
|
270
184
|
```python
|
|
185
|
+
from typing import List
|
|
271
186
|
from ex4nicegui import rxui, Ref
|
|
272
187
|
from itertools import count
|
|
188
|
+
from nicegui import ui
|
|
273
189
|
|
|
274
190
|
id_generator = count()
|
|
275
191
|
|
|
276
192
|
class Person(rxui.ViewModel):
|
|
277
|
-
name
|
|
278
|
-
age = rxui.var(0)
|
|
279
|
-
|
|
280
|
-
def __init__(self, name: str = "", age: int = 0):
|
|
193
|
+
def __init__(self, name: str, age: int):
|
|
281
194
|
super().__init__()
|
|
282
|
-
self.name
|
|
283
|
-
self.age
|
|
195
|
+
self.name = rxui.var(name)
|
|
196
|
+
self.age = rxui.var(age)
|
|
284
197
|
self.id = next(id_generator)
|
|
285
198
|
|
|
286
199
|
|
|
@@ -322,6 +235,7 @@ with ui.row():
|
|
|
322
235
|
rxui.input(value=person.name, placeholder="名字")
|
|
323
236
|
rxui.number(value=person.age, min=1, max=100, step=1, placeholder="年龄")
|
|
324
237
|
|
|
238
|
+
ui.run()
|
|
325
239
|
```
|
|
326
240
|
|
|
327
241
|
如果你觉得 `rxui.vfor` 代码过于复杂,可以使用 `effect_refreshable` 装饰器代替。
|
|
@@ -330,7 +244,7 @@ with ui.row():
|
|
|
330
244
|
from ex4nicegui import rxui, Ref,effect_refreshable
|
|
331
245
|
...
|
|
332
246
|
|
|
333
|
-
# 明确指定监控 home.persons
|
|
247
|
+
# 明确指定监控 home.persons 变化,可以避免意外刷新
|
|
334
248
|
@effect_refreshable.on(home.persons)
|
|
335
249
|
def _():
|
|
336
250
|
|
|
@@ -347,6 +261,127 @@ def _():
|
|
|
347
261
|
|
|
348
262
|
---
|
|
349
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
|
+
|
|
350
385
|
## 响应式
|
|
351
386
|
|
|
352
387
|
```python
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- [教程](#教程)
|
|
10
10
|
- [安装](#-安装)
|
|
11
11
|
- [使用](#-使用)
|
|
12
|
-
- [
|
|
12
|
+
- [图表](#-图表)
|
|
13
13
|
- [BI 模块](#bi-模块)
|
|
14
14
|
|
|
15
15
|
对 [nicegui](https://github.com/zauberzeug/nicegui) 做的扩展库。内置响应式组件,完全实现数据响应式界面编程。
|
|
@@ -40,10 +40,10 @@ pip install ex4nicegui -U
|
|
|
40
40
|
|
|
41
41
|
## 🦄 使用
|
|
42
42
|
|
|
43
|
+

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

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

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

|
|
105
62
|
|
|
106
|
-
以下例子绑定鼠标单击事件
|
|
107
63
|
```python
|
|
108
64
|
from nicegui import ui
|
|
109
|
-
from ex4nicegui
|
|
110
|
-
|
|
111
|
-
opts = {
|
|
112
|
-
"xAxis": {"type": "value", "boundaryGap": [0, 0.01]},
|
|
113
|
-
"yAxis": {
|
|
114
|
-
"type": "category",
|
|
115
|
-
"data": ["Brazil", "Indonesia", "USA", "India", "China", "World"],
|
|
116
|
-
},
|
|
117
|
-
"series": [
|
|
118
|
-
{
|
|
119
|
-
"name": "first",
|
|
120
|
-
"type": "bar",
|
|
121
|
-
"data": [18203, 23489, 29034, 104970, 131744, 630230],
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"name": "second",
|
|
125
|
-
"type": "bar",
|
|
126
|
-
"data": [19325, 23438, 31000, 121594, 134141, 681807],
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
}
|
|
65
|
+
from ex4nicegui import rxui, to_ref
|
|
130
66
|
|
|
131
|
-
|
|
67
|
+
ui.radio.default_props("inline")
|
|
132
68
|
|
|
133
|
-
|
|
134
|
-
|
|
69
|
+
# 定义视图数据
|
|
70
|
+
colors = ["red", "green", "blue", "yellow", "purple", "white"]
|
|
71
|
+
color = to_ref("blue")
|
|
72
|
+
bg_color = to_ref("red")
|
|
135
73
|
|
|
136
74
|
|
|
137
|
-
|
|
138
|
-
|
|
75
|
+
## 函数中通过访问 `ref` 或其他关联函数获取值,一切会自动同步更新
|
|
76
|
+
def bg_text():
|
|
77
|
+
return f"Current background color is {bg_color.value}"
|
|
139
78
|
|
|
140
79
|
|
|
141
|
-
|
|
142
|
-
```python
|
|
143
|
-
from nicegui import ui
|
|
144
|
-
from ex4nicegui.reactive import rxui
|
|
80
|
+
# 界面
|
|
145
81
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
"data": ["Brazil", "Indonesia", "USA", "India", "China", "World"],
|
|
151
|
-
},
|
|
152
|
-
"series": [
|
|
153
|
-
{
|
|
154
|
-
"name": "first",
|
|
155
|
-
"type": "bar",
|
|
156
|
-
"data": [18203, 23489, 29034, 104970, 131744, 630230],
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"name": "second",
|
|
160
|
-
"type": "bar",
|
|
161
|
-
"data": [19325, 23438, 31000, 121594, 134141, 681807],
|
|
162
|
-
},
|
|
163
|
-
],
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
bar = rxui.echarts(opts)
|
|
167
|
-
|
|
168
|
-
def on_first_series_mouseover(e: rxui.echarts.EChartsMouseEventArguments):
|
|
169
|
-
ui.notify(f"on_first_series_mouseover:{e.seriesName}:{e.name}:{e.value}")
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
bar.on("mouseover", on_first_series_mouseover, query={"seriesName": "first"})
|
|
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})
|
|
173
86
|
|
|
174
|
-
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})
|
|
175
91
|
```
|
|
176
|
-
---
|
|
177
|
-
|
|
178
92
|
|
|
179
93
|
|
|
180
94
|
## ViewModel
|
|
@@ -245,19 +159,18 @@ class Home(rxui.ViewModel):
|
|
|
245
159
|
通过 `number` 组件修改年龄,一切都会自动更新。
|
|
246
160
|
|
|
247
161
|
```python
|
|
162
|
+
from typing import List
|
|
248
163
|
from ex4nicegui import rxui, Ref
|
|
249
164
|
from itertools import count
|
|
165
|
+
from nicegui import ui
|
|
250
166
|
|
|
251
167
|
id_generator = count()
|
|
252
168
|
|
|
253
169
|
class Person(rxui.ViewModel):
|
|
254
|
-
name
|
|
255
|
-
age = rxui.var(0)
|
|
256
|
-
|
|
257
|
-
def __init__(self, name: str = "", age: int = 0):
|
|
170
|
+
def __init__(self, name: str, age: int):
|
|
258
171
|
super().__init__()
|
|
259
|
-
self.name
|
|
260
|
-
self.age
|
|
172
|
+
self.name = rxui.var(name)
|
|
173
|
+
self.age = rxui.var(age)
|
|
261
174
|
self.id = next(id_generator)
|
|
262
175
|
|
|
263
176
|
|
|
@@ -299,6 +212,7 @@ with ui.row():
|
|
|
299
212
|
rxui.input(value=person.name, placeholder="名字")
|
|
300
213
|
rxui.number(value=person.age, min=1, max=100, step=1, placeholder="年龄")
|
|
301
214
|
|
|
215
|
+
ui.run()
|
|
302
216
|
```
|
|
303
217
|
|
|
304
218
|
如果你觉得 `rxui.vfor` 代码过于复杂,可以使用 `effect_refreshable` 装饰器代替。
|
|
@@ -307,7 +221,7 @@ with ui.row():
|
|
|
307
221
|
from ex4nicegui import rxui, Ref,effect_refreshable
|
|
308
222
|
...
|
|
309
223
|
|
|
310
|
-
# 明确指定监控 home.persons
|
|
224
|
+
# 明确指定监控 home.persons 变化,可以避免意外刷新
|
|
311
225
|
@effect_refreshable.on(home.persons)
|
|
312
226
|
def _():
|
|
313
227
|
|
|
@@ -324,6 +238,127 @@ def _():
|
|
|
324
238
|
|
|
325
239
|
---
|
|
326
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
|
+
|
|
327
362
|
## 响应式
|
|
328
363
|
|
|
329
364
|
```python
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import 'echarts'
|
|
1
2
|
import { convertDynamicProperties } from "../../static/utils/dynamic_properties.js";
|
|
2
3
|
|
|
3
4
|
function collectMapRegisterTask() {
|
|
@@ -54,10 +55,8 @@ const mapRegisterTasks = collectMapRegisterTask();
|
|
|
54
55
|
export default {
|
|
55
56
|
template: "<div></div>",
|
|
56
57
|
async mounted() {
|
|
57
|
-
await
|
|
58
|
-
|
|
58
|
+
await new Promise((resolve) => setTimeout(resolve, 0)); // wait for Tailwind classes to be applied
|
|
59
59
|
this.chart = echarts.init(this.$el, this.theme);
|
|
60
|
-
|
|
61
60
|
this.resizeObs = new ResizeObserver(this.chart.resize)
|
|
62
61
|
|
|
63
62
|
// Prevent interruption of chart animations due to resize operations.
|