-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Field.display:DisplayProcessor ignored by displayProcessor.ts or the documentation of Field is wrong. (code or doc bug). #37237
Comments
Please ask your question on community.grafana.com/. To avoid having your issue closed in the future, please read our CONTRIBUTING guidelines. Happy graphing! |
It's sort of weird that this is labelled this as a question, I was trying to be polite. I am pretty sure that this is either a code bug or incorrect documentation. That is, if this field is not used, then the doc should say so. This is not a Grafana user question, but a plugin development question. Matt, if you still are seeing this, I cannot see a place on community.grafana.com where plugin developers talk. I may have missed something. |
It is used by almost all panels, and is set in the data frame processing in applyFieldOverrides , so returning this from the data source might not work / is not supported. |
So is the is disposition of this issue that it is a doc bug then? If it is indeed optional that a Panel component may or may not use it DisplayProcessors, that should be documented. Or should there be a bug on Table that it does not follow the correct pattern. Can I can contribute a fix? EDIT: I just looked again at applyFieldOverrides(), and I don't see Field.display being referenced or used. I see it being set unconditionally to the returned value (a function) of getDisplayProcessor() which never uses Field.display. I think having a datasource being able to provide a display processor is a great feature, and the documetation at https://grafana.com/docs/grafana/latest/packages_api/data/field/ implies that this should work. That is, DataSources define fields, and fields have DisplayProcessors, so it really looks like it's supported. And since you say it's not supported, shouldn't the doc just say "Do not store anything here in Field.display, it's an internal member that is built that is wholly owned by FieldOverrides.ts". |
I am defining a DataSource and I wanted to build a custom formatting of some values of some fields. I read the documentation at https://grafana.com/docs/grafana/latest/packages_api/data/field/ is implying that if a DisplayProcessor is placed in the optional display property of Field, that it will be used to convert a raw value to a DisplayValue. However, I find no path in the code from the Table UI Panel component that actually uses the function that is in field.display. It seems that unconditional that a function returned from getDisplayProcessor in packages/data/src/field/displayProcessor.ts is used as the displayProcessor. The field's display property is not referenced. I apologize if I have misunderstood the intention of the design.
Thanks,
Joe
The text was updated successfully, but these errors were encountered: