molstar / mol-view-spec

https://molstar.org/mol-view-spec/
MIT License
8 stars 1 forks source link

Support for vendor extensions #22

Open papillot opened 2 months ago

papillot commented 2 months ago

I understand that the whole point of the project is to be vendor agnostic, but let's say that a given vendor would like to store extra elements in a spec file, is there a way to ensure that the file is still compliant with the specs?

One use case of such an extension mechanism, would be the CommonChem JSON format, which has an extension property which may contain vendor specific data https://github.com/CommonChem/CommonChem/blob/master/spec.md#extension-object

JonStargaryen commented 2 months ago

Interesting suggestion. With the current approach, it would e.g. be possible to include vendor-specific data in the source CIF file, in a custom CIF category. Specific viewers could consider that data without affecting the behavior of other viewers.

papillot commented 2 months ago

I see, yes some kind data might be amenable to this CIF based approach.

I was thinking also about the case where one would want to give extra properties to some objects of the molview hierarchy. For example, the scenario for describing a color scheme as 'color by secondary structure' has been suggested before ( #19 ). With an extension it could be possible to remain consistent with the specs (describe the color for each residue) and also have the extended property which some consumers can interpret.

But, I completely get the concern with implementing escape hatches in a standard: this may get nasty very quickly...