Version 3.16¶
guidata Version 3.16.0¶
✨ New features:
Local automatic sliders for numeric
DataSetitems —DataSetEditLayout(and derived group boxes/dialogs) can now opt into adding sliders to editable, bounded numeric items without changing sharedDataItemdeclarations or affecting other forms. Enable it withDataSetEditLayout(..., auto_sliders=True); the policy is inherited by nested groups and tabs. Editable items need finite, ordered, representable bounds to receive a slider — integer parity (even) andnonzeroranges crossing zero are respected, unusable items remain text-only. For floats, a usable positivestepis reused when practical, otherwise the newslider_stepsparameter sets the normalized resolution (default 1000). The text field always keeps the exact underlying value, independently of the slider thumb resolution. Useitem.set_prop("display", auto_slider=False)to exclude a specific item from the policy. An optionalslider_callback(pressed)reports drag start/end without affecting the existingchange_callbackvalue-change notifications.slider=Trueon individual items keeps its previous behavior unchanged.HistogramRangeItem— histogram-backed interval selection — added a newDataItemthat edits two distinctFloatItemfields of the same dataset through a single histogram-backed range editor widget. The caller supplies a rendering payload (bincounts, a finite ordereddomain, optionaly_max,minimum_width,auto_rangeandreset_rangeproposals); guidata never inspects source arrays or computes a range on its own. The default"range"presentation shows a plain interval selector suitable for generic measurements (durations, thresholds, …); settingdisplay.presentationto"brightness_contrast"adds brightness/contrast sliders and a linear transfer function overlay for image-oriented use cases. The item is transient: only the two linked numeric fields are persisted (HDF5/JSON/INI), so applications must restore the histogram context after loading before editing is possible. Adisplay.callback(instance, item, value)is invoked once per valid edited pair, with both bounds already applied to the working dataset, matching the behavior of other guidata live callbacks. The JSON Schema exporter emits a dedicated"histogram_range"kind withx-guidata-minimum-field,x-guidata-maximum-fieldandx-guidata-histogram-presentationextension keywords so portable renderers can reproduce the same behavior. See the examples andHistogramRangeItemreference documentation for a complete, tested duration-selection walkthrough.
🛠 Bug fixes:
Empty optional numeric fields rejected in forms —
IntItemandFloatItemdeclared withallow_none=TrueacceptedNonewhen set programmatically, butcheck_valuerejected it, so an empty optional field was highlighted as invalid andDataSetEditLayout.check_all_values()refused the whole form (e.g. on dialog validation).check_valuenow acceptsNonefor optional numeric items, while still validating non-Nonevalues against their constraints (min,max,nonzero,even) and rejectingNonefor required items. Text fields only acceptNonefrom an empty input: malformed entries (e.g.abcin a numeric field) remain invalid instead of being stored asNone.