dara-core 1.17.2__py3-none-any.whl → 1.17.4__py3-none-any.whl

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.
@@ -45830,9 +45830,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
45830
45830
  }
45831
45831
  function FilterContainer(props) {
45832
45832
  var _a;
45833
- const [visible, setVisible] = React.useState(false);
45834
- const show = () => setVisible(true);
45835
- const hide2 = () => setVisible(false);
45833
+ const [isOpen, setIsOpen] = React.useState(false);
45836
45834
  const hasFilter = !(props.col.filterValue === void 0 || ((_a = props.col.filterValue) === null || _a === void 0 ? void 0 : _a.selected) === "None" || Array.isArray(props.col.filterValue) && props.col.filterValue.length === 0);
45837
45835
  const items = React.useMemo(() => {
45838
45836
  var _a2;
@@ -45841,16 +45839,29 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
45841
45839
  }
45842
45840
  }, [props.col]);
45843
45841
  const portalsRef = React.useRef([]);
45844
- function onClickOutside(instance, event) {
45845
- const target = event.target;
45846
- for (const portal of portalsRef.current) {
45847
- if (portal === null || portal === void 0 ? void 0 : portal.contains(target)) {
45848
- return;
45842
+ const { refs, floatingStyles, context: context2 } = useFloating({
45843
+ open: isOpen,
45844
+ onOpenChange: setIsOpen,
45845
+ placement: "bottom-start",
45846
+ middleware: [offset$2(8), flip$2(), shift({ padding: 8 })],
45847
+ whileElementsMounted: autoUpdate
45848
+ });
45849
+ const click = useClick(context2);
45850
+ const dismiss = useDismiss(context2, {
45851
+ outsidePress: (event) => {
45852
+ const target = event.target;
45853
+ for (const portal of portalsRef.current) {
45854
+ if (portal === null || portal === void 0 ? void 0 : portal.contains(target)) {
45855
+ return false;
45856
+ }
45849
45857
  }
45858
+ return true;
45850
45859
  }
45851
- hide2();
45852
- }
45853
- return jsxRuntime.exports.jsx(Tooltip, { content: props.col.render("Filter", { items, onChange: hide2, portalsRef }), hidden: true, interactive: true, onClickOutside, visible, children: jsxRuntime.exports.jsx("span", { children: jsxRuntime.exports.jsx(HeaderIconWrapper, { hasFilter, children: jsxRuntime.exports.jsx(FilterIcon, { "$hasFilter": hasFilter, icon: faFilter, onClick: show }) }) }) });
45860
+ });
45861
+ const role = useRole(context2);
45862
+ const { getReferenceProps, getFloatingProps } = useInteractions([click, dismiss, role]);
45863
+ const hide2 = () => setIsOpen(false);
45864
+ return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment, { children: [jsxRuntime.exports.jsx("span", Object.assign({ ref: refs.setReference }, getReferenceProps(), { children: jsxRuntime.exports.jsx(HeaderIconWrapper, { hasFilter, children: jsxRuntime.exports.jsx(FilterIcon, { "$hasFilter": hasFilter, icon: faFilter }) }) })), jsxRuntime.exports.jsx(FloatingPortal, { children: jsxRuntime.exports.jsx("div", Object.assign({ ref: refs.setFloating, style: Object.assign(Object.assign({}, floatingStyles), { zIndex: 9999, pointerEvents: "auto", display: isOpen ? "block" : "none" }) }, getFloatingProps(), { children: props.col.render("Filter", { items, onChange: hide2, portalsRef }) })) })] });
45854
45865
  }
45855
45866
  var CheckboxState;
45856
45867
  (function(CheckboxState2) {
@@ -52939,27 +52950,6 @@ Inferred class string: "${iconClasses}."`
52939
52950
  function isTaskResponse$1(dvResponse) {
52940
52951
  return "task_id" in dvResponse;
52941
52952
  }
52942
- function formatDerivedVariableRequest(values) {
52943
- return values.map((val) => {
52944
- if (isResolvedDerivedVariable(val) || isResolvedDerivedDataVariable(val)) {
52945
- const { deps, values: nestedValues, ...rest } = val;
52946
- return {
52947
- ...rest,
52948
- force: false,
52949
- values: formatDerivedVariableRequest(nestedValues)
52950
- };
52951
- }
52952
- if (isResolvedSwitchVariable(val)) {
52953
- return {
52954
- ...val,
52955
- value: formatDerivedVariableRequest([val.value])[0],
52956
- value_map: formatDerivedVariableRequest([val.value_map])[0],
52957
- default: formatDerivedVariableRequest([val.default])[0]
52958
- };
52959
- }
52960
- return val;
52961
- });
52962
- }
52963
52953
  async function fetchDerivedVariable({
52964
52954
  cache: cache2,
52965
52955
  force,
@@ -53158,10 +53148,7 @@ Inferred class string: "${iconClasses}."`
53158
53148
  force: derivedResult.force,
53159
53149
  is_data_variable: isDerivedDataVariable(variable),
53160
53150
  selectorKey,
53161
- values: normalizeRequest(
53162
- formatDerivedVariableRequest(derivedResult.values),
53163
- variable.variables
53164
- ),
53151
+ values: normalizeRequest(cleanArgs(derivedResult.values, false), variable.variables),
53165
53152
  variableUid: variable.uid,
53166
53153
  wsClient
53167
53154
  });
@@ -53427,6 +53414,38 @@ Inferred class string: "${iconClasses}."`
53427
53414
  }
53428
53415
  return resolver(getOrRegisterPlainVariable(variable, client, taskContext, extras));
53429
53416
  }
53417
+ function cleanValue(value, force) {
53418
+ if (isResolvedDerivedVariable(value) || isResolvedDerivedDataVariable(value)) {
53419
+ const { deps, ...rest } = value;
53420
+ const cleanedValues = value.values.map((v2) => cleanValue(v2, force));
53421
+ return {
53422
+ ...rest,
53423
+ force,
53424
+ values: cleanedValues
53425
+ };
53426
+ }
53427
+ if (isResolvedSwitchVariable(value)) {
53428
+ return {
53429
+ ...value,
53430
+ value: cleanValue(value.value, force),
53431
+ value_map: cleanValue(value.value_map, force),
53432
+ default: cleanValue(value.default, force)
53433
+ };
53434
+ }
53435
+ return value;
53436
+ }
53437
+ function cleanKwargs(kwargs, force) {
53438
+ return Object.keys(kwargs).reduce(
53439
+ (acc, k2) => {
53440
+ acc[k2] = cleanValue(kwargs[k2], force);
53441
+ return acc;
53442
+ },
53443
+ {}
53444
+ );
53445
+ }
53446
+ function cleanArgs(values, force) {
53447
+ return values.map((val) => cleanValue(val, force));
53448
+ }
53430
53449
  /*!
53431
53450
  * https://github.com/Starcounter-Jack/JSON-Patch
53432
53451
  * (c) 2017-2022 Joachim Wester
@@ -54685,7 +54704,7 @@ Inferred class string: "${iconClasses}."`
54685
54704
  execution_id: executionId,
54686
54705
  input,
54687
54706
  uid: annotatedAction.uid,
54688
- values: normalizeRequest(resolvedKwargs, annotatedAction.dynamic_kwargs),
54707
+ values: normalizeRequest(cleanKwargs(resolvedKwargs, false), annotatedAction.dynamic_kwargs),
54689
54708
  ws_channel
54690
54709
  }),
54691
54710
  method: HTTP_METHOD.POST
@@ -55028,7 +55047,7 @@ Inferred class string: "${iconClasses}."`
55028
55047
  force: false,
55029
55048
  selectorKey: resolved.uid,
55030
55049
  values: normalizeRequest(
55031
- formatDerivedVariableRequest(resolved.values),
55050
+ cleanArgs(resolved.values, false),
55032
55051
  variable.variables
55033
55052
  ),
55034
55053
  variableUid: resolved.uid,
@@ -55353,35 +55372,6 @@ Inferred class string: "${iconClasses}."`
55353
55372
  const result = await res.json();
55354
55373
  return result;
55355
55374
  }
55356
- function cleanValue(value, force) {
55357
- if (isResolvedDerivedVariable(value) || isResolvedDerivedDataVariable(value)) {
55358
- const { deps, ...rest } = value;
55359
- const cleanedValues = value.values.map((v2) => cleanValue(v2, force));
55360
- return {
55361
- ...rest,
55362
- force,
55363
- values: cleanedValues
55364
- };
55365
- }
55366
- if (isResolvedSwitchVariable(value)) {
55367
- return {
55368
- ...value,
55369
- value: cleanValue(value.value, force),
55370
- value_map: cleanValue(value.value_map, force),
55371
- default: cleanValue(value.default, force)
55372
- };
55373
- }
55374
- return value;
55375
- }
55376
- function cleanKwargs(kwargs, force) {
55377
- return Object.keys(kwargs).reduce(
55378
- (acc, k2) => {
55379
- acc[k2] = cleanValue(kwargs[k2], force);
55380
- return acc;
55381
- },
55382
- {}
55383
- );
55384
- }
55385
55375
  function getOrRegisterComponentTrigger(uid2, loop_instance_uid) {
55386
55376
  const triggerKey = getComponentRegistryKey(uid2, true, loop_instance_uid);
55387
55377
  if (!atomRegistry.has(triggerKey)) {
@@ -82671,7 +82661,6 @@ Inferred class string: "${iconClasses}."`
82671
82661
  exports.atomRegistry = atomRegistry;
82672
82662
  exports.cancelTask = cancelTask;
82673
82663
  exports.cleanSessionCache = cleanSessionCache;
82674
- exports.cleanValue = cleanValue;
82675
82664
  exports.clearActionHandlerCache_TEST = clearActionHandlerCache_TEST;
82676
82665
  exports.clearCaches_TEST = clearCaches_TEST;
82677
82666
  exports.clearRegistries_TEST = clearRegistries_TEST;
@@ -82681,7 +82670,6 @@ Inferred class string: "${iconClasses}."`
82681
82670
  exports.depsRegistry = depsRegistry;
82682
82671
  exports.fetchDerivedVariable = fetchDerivedVariable;
82683
82672
  exports.fetchTaskResult = fetchTaskResult;
82684
- exports.formatDerivedVariableRequest = formatDerivedVariableRequest;
82685
82673
  exports.getComponentRegistryKey = getComponentRegistryKey;
82686
82674
  exports.getDeps = getDeps;
82687
82675
  exports.getIcon = getIcon;
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dara-core
3
- Version: 1.17.2
3
+ Version: 1.17.4
4
4
  Summary: Dara Framework Core
5
5
  Home-page: https://dara.causalens.com/
6
6
  License: Apache-2.0
@@ -20,10 +20,10 @@ Requires-Dist: async-asgi-testclient (>=1.4.11,<2.0.0)
20
20
  Requires-Dist: certifi (>=2024.7.4)
21
21
  Requires-Dist: click (==8.1.3)
22
22
  Requires-Dist: colorama (>=0.4.6,<0.5.0)
23
- Requires-Dist: create-dara-app (==1.17.2)
23
+ Requires-Dist: create-dara-app (==1.17.4)
24
24
  Requires-Dist: croniter (>=1.0.15,<3.0.0)
25
25
  Requires-Dist: cryptography (>=42.0.4)
26
- Requires-Dist: dara-components (==1.17.2) ; extra == "all"
26
+ Requires-Dist: dara-components (==1.17.4) ; extra == "all"
27
27
  Requires-Dist: exceptiongroup (>=1.1.3,<2.0.0)
28
28
  Requires-Dist: fastapi (>=0.115.0,<0.116.0)
29
29
  Requires-Dist: fastapi_vite_dara (==0.4.0)
@@ -54,7 +54,7 @@ Description-Content-Type: text/markdown
54
54
 
55
55
  # Dara Application Framework
56
56
 
57
- <img src="https://github.com/causalens/dara/blob/v1.17.2/img/dara_light.svg?raw=true">
57
+ <img src="https://github.com/causalens/dara/blob/v1.17.4/img/dara_light.svg?raw=true">
58
58
 
59
59
  ![Master tests](https://github.com/causalens/dara/actions/workflows/tests.yml/badge.svg?branch=master)
60
60
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
@@ -99,7 +99,7 @@ source .venv/bin/activate
99
99
  dara start
100
100
  ```
101
101
 
102
- ![Dara App](https://github.com/causalens/dara/blob/v1.17.2/img/components_gallery.png?raw=true)
102
+ ![Dara App](https://github.com/causalens/dara/blob/v1.17.4/img/components_gallery.png?raw=true)
103
103
 
104
104
  Note: `pip` installation uses [PEP 660](https://peps.python.org/pep-0660/) `pyproject.toml`-based editable installs which require `pip >= 21.3` and `setuptools >= 64.0.0`. You can upgrade both with:
105
105
 
@@ -116,9 +116,9 @@ Explore some of our favorite apps - a great way of getting started and getting t
116
116
 
117
117
  | Dara App | Description |
118
118
  | -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
119
- | ![Large Language Model](https://github.com/causalens/dara/blob/v1.17.2/img/llm.png?raw=true) | Demonstrates how to use incorporate a LLM chat box into your decision app to understand model insights |
120
- | ![Plot Interactivity](https://github.com/causalens/dara/blob/v1.17.2/img/plot_interactivity.png?raw=true) | Demonstrates how to enable the user to interact with plots, trigger actions based on clicks, mouse movements and other interactions with `Bokeh` or `Plotly` plots |
121
- | ![Graph Editor](https://github.com/causalens/dara/blob/v1.17.2/img/graph_viewer.png?raw=true) | Demonstrates how to use the `CausalGraphViewer` component to display your graphs or networks, customising the displayed information through colors and tooltips, and updating the page based on user interaction. |
119
+ | ![Large Language Model](https://github.com/causalens/dara/blob/v1.17.4/img/llm.png?raw=true) | Demonstrates how to use incorporate a LLM chat box into your decision app to understand model insights |
120
+ | ![Plot Interactivity](https://github.com/causalens/dara/blob/v1.17.4/img/plot_interactivity.png?raw=true) | Demonstrates how to enable the user to interact with plots, trigger actions based on clicks, mouse movements and other interactions with `Bokeh` or `Plotly` plots |
121
+ | ![Graph Editor](https://github.com/causalens/dara/blob/v1.17.4/img/graph_viewer.png?raw=true) | Demonstrates how to use the `CausalGraphViewer` component to display your graphs or networks, customising the displayed information through colors and tooltips, and updating the page based on user interaction. |
122
122
 
123
123
  Check out our [App Gallery](https://dara.causalens.com/gallery) for more inspiration!
124
124
 
@@ -145,9 +145,9 @@ And the supporting UI packages and tools.
145
145
  - `ui-utils` - miscellaneous utility functions
146
146
  - `ui-widgets` - widget components
147
147
 
148
- More information on the repository structure can be found in the [CONTRIBUTING.md](https://github.com/causalens/dara/blob/v1.17.2/CONTRIBUTING.md) file.
148
+ More information on the repository structure can be found in the [CONTRIBUTING.md](https://github.com/causalens/dara/blob/v1.17.4/CONTRIBUTING.md) file.
149
149
 
150
150
  ## License
151
151
 
152
- Dara is open-source and licensed under the [Apache 2.0 License](https://github.com/causalens/dara/blob/v1.17.2/LICENSE).
152
+ Dara is open-source and licensed under the [Apache 2.0 License](https://github.com/causalens/dara/blob/v1.17.4/LICENSE).
153
153
 
@@ -83,7 +83,7 @@ dara/core/metrics/cache.py,sha256=bGXwjO_rSc-FkS3PnPi1mvIZf1x-hvmG113dAUk1g-Y,26
83
83
  dara/core/metrics/runtime.py,sha256=YP-6Dz0GeI9_Yr7bUk_-OqShyFySGH_AKpDO126l6es,1833
84
84
  dara/core/metrics/utils.py,sha256=aKaa_hskV3M3h4xOGZYvegDLq_OWOEUlslkQKrrPQiI,2281
85
85
  dara/core/persistence.py,sha256=-lnksbGfHwabeRjbJkceoFd0kHfCu4gK2fud8dkeDTg,18538
86
- dara/core/umd/dara.core.umd.js,sha256=XNr43n2tSWqKbOCkZTqqffmkqTVhaz784rziVqPJdt8,4730577
86
+ dara/core/umd/dara.core.umd.js,sha256=JdiQ4KklJYuBnXQP84iJC74AwUOrj9SXQ8VNOcwZMUQ,4730571
87
87
  dara/core/umd/style.css,sha256=YQtQ4veiSktnyONl0CU1iU1kKfcQhreH4iASi1MP7Ak,4095007
88
88
  dara/core/visual/__init__.py,sha256=QN0wbG9HPQ_vXh8BO8DnBXeYLIENVTNtRmYzZf1lx7c,577
89
89
  dara/core/visual/components/__init__.py,sha256=eg6M2YcH1o-I2H3IqLaD32ExfZcXhKuH5KTM52Ow6RM,2359
@@ -107,8 +107,8 @@ dara/core/visual/themes/__init__.py,sha256=aM4mgoIYo2neBSw5FRzswsht7PUKjLthiHLmF
107
107
  dara/core/visual/themes/dark.py,sha256=UQGDooOc8ric73eHs9E0ltYP4UCrwqQ3QxqN_fb4PwY,1942
108
108
  dara/core/visual/themes/definitions.py,sha256=nS_gQvOzCt5hTmj74d0_siq_9QWuj6wNuir4VCHy0Dk,2779
109
109
  dara/core/visual/themes/light.py,sha256=-Tviq8oEwGbdFULoDOqPuHO0UpAZGsBy8qFi0kAGolQ,1944
110
- dara_core-1.17.2.dist-info/LICENSE,sha256=r9u1w2RvpLMV6YjuXHIKXRBKzia3fx_roPwboGcLqCc,10944
111
- dara_core-1.17.2.dist-info/METADATA,sha256=vImK50_0SvInMHasAvOdr-Yrz1mZ4p3a-qLhWjYJZ5g,7497
112
- dara_core-1.17.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
113
- dara_core-1.17.2.dist-info/entry_points.txt,sha256=H__D5sNIGuPIhVam0DChNL-To5k8Y7nY7TAFz9Mz6cc,139
114
- dara_core-1.17.2.dist-info/RECORD,,
110
+ dara_core-1.17.4.dist-info/LICENSE,sha256=r9u1w2RvpLMV6YjuXHIKXRBKzia3fx_roPwboGcLqCc,10944
111
+ dara_core-1.17.4.dist-info/METADATA,sha256=0TqqP_mIZu5gSiOO5OBAlupFwzCgtdrhCGQe7UXRDZ8,7497
112
+ dara_core-1.17.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
113
+ dara_core-1.17.4.dist-info/entry_points.txt,sha256=H__D5sNIGuPIhVam0DChNL-To5k8Y7nY7TAFz9Mz6cc,139
114
+ dara_core-1.17.4.dist-info/RECORD,,