You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
often when developing short-hand names are used, they don't contain spaces and are selected for ease of writing code.
when displaying results to a user the backend names are often mapped to user facing titles.
it would be great if ipydatagrid facilitated this.
in autoui we care mostly about the jsonable value so we have a records property which does the mapping back to name rather than title.
it would be good if we could unpick some of this functionality and add it to ipydatagrid
Describe alternatives you've considered
when I looked at this again i thought that it might actually be better to use renderers rather than actually changing the underlying data
I could imagine adding a map_name_title trait which automatically applies this renderer on_change... ? this is good as you don't need to change the underlying dataframe.
the issues I see with this are:
we're taking control of the header_renderer making it unavailable to the user. it would be better if it could be done independently of that?
I don't know if this can be made to work with a multi-index title ?
Additional context
I was having a poke around thinking about where this could be best added to ipydatagrid...
pandas defines the schema like this: https://specs.frictionlessdata.io/table-schema/
which explicitly supports a title (and description which would be great as a column heading tooltip!)
but unfortunately i don't think there is a way of add these metadata fields to a pandas dataframe object.
I think it would be good if the schema was also a trait - if not given it is defined by the dataframe, otherwise it can be used to add additional metadata about the dataframe... with some logic to ensure the 2 things are consistent
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
often when developing short-hand names are used, they don't contain spaces and are selected for ease of writing code.
when displaying results to a user the backend names are often mapped to user facing titles.
it would be great if
ipydatagrid
facilitated this.Describe the solution you'd like
in
ipyautoui
we implemented something that does this - ipyautoui requires a schema which gives the user the opportunity to define a title. we overrideDataGrid
withAutoGrid
and in the__init__
we check if titles are present and update the dataframe before settinghttps://github.com/maxfordham/ipyautoui/blob/782955ed379cd2b4f53b0ec0de74557813c2e80e/src/ipyautoui/custom/autogrid.py#L667-L696
something like this:
https://github.com/maxfordham/ipyautoui/blob/782955ed379cd2b4f53b0ec0de74557813c2e80e/src/ipyautoui/custom/autogrid.py#L432-L438
in autoui we care mostly about the jsonable value so we have a
records
property which does the mapping back to name rather than title.it would be good if we could unpick some of this functionality and add it to
ipydatagrid
Describe alternatives you've considered
when I looked at this again i thought that it might actually be better to use renderers rather than actually changing the underlying data
i.e.
I could imagine adding a
map_name_title
trait which automatically applies this renderer on_change... ? this is good as you don't need to change the underlying dataframe.the issues I see with this are:
header_renderer
making it unavailable to the user. it would be better if it could be done independently of that?Additional context
I was having a poke around thinking about where this could be best added to
ipydatagrid
...pandas defines the schema like this:
https://specs.frictionlessdata.io/table-schema/
which explicitly supports a
title
(anddescription
which would be great as a column heading tooltip!)but unfortunately i don't think there is a way of add these metadata fields to a pandas dataframe object.
the main issue that i see is that the setting of the dataframe is the only required field. setting the dataframe happens first (before other traits are set) :
https://github.com/bloomberg/ipydatagrid/blob/c7cf3a48756264db92218ac40a0d5417a078dc9a/ipydatagrid/datagrid.py#L372-L380
this then creates the schema:
https://github.com/bloomberg/ipydatagrid/blob/c7cf3a48756264db92218ac40a0d5417a078dc9a/ipydatagrid/datagrid.py#L441-L467
I think it would be good if the schema was also a
trait
- if not given it is defined by the dataframe, otherwise it can be used to add additional metadata about the dataframe... with some logic to ensure the 2 things are consistentThe text was updated successfully, but these errors were encountered: