SED-ML / sed-ml

Simulation Experiment Description Markup Language (SED-ML)
http://sed-ml.org
5 stars 2 forks source link

Clarification needed which style components are used to style the bar plots #140

Closed matthiaskoenig closed 3 years ago

matthiaskoenig commented 3 years ago

There is some ambiguity in what color to use for the bar plots. It could be either the color of the Marker or the color of the Fill. Also what to do with the line style information is unclear.

Personally I interpret the barplots just as large markers and so the complete Marker style should be applied to style the bar. This has the advantage that all Curves are styled with the identical information (linestyle & marker), the fill information is not used for any Curves. Bar plots only use the marker information (and no linestyle nor fill information). So there is a clear separation of the style information for the different curve types.

There is currently a sentence in the style section stating the fill part:

"The Fill of a Style has no meaning for a Curve, and, if present, will be ignored."

A similar sentence should be added to the curve types to clarify the marker part.:

"The Fill of a Style has no meaning for a Curve, and, if present, will be ignored. For the bar Curves the Line of a Style has no meaning, and, if present, will be ignored."

@luciansmith I saw you used a mix of Fill and Line information to style the bars (example stacked_bar).

 <listOfStyles>
    <style id="blue_with_purple">
      <line color="#FF00FF" thickness="4"/>
      <fill color="#0000FF"/>
    </style>
    <style id="blue_with_red">
      <line color="#FF000033" thickness="4"/>
      <fill color="#aaaaFFaa"/>
    </style>
  </listOfStyles>

In my opinion the correct way to encode the style for the bar is

 <listOfStyles>
    <style id="blue_with_purple">
      <marker fill="#0000FF" lineColor="#FF00FF" lineThickness="4"/>
    </style>
    <style id="blue_with_red">
      <marker fill="#aaaaFFaa" lineColor="#FF000033" lineThickness="4"/>
    </style>
  </listOfStyles>

To get the following result: image I added the example as stacked_bar2.sedml to the test cases.

luciansmith commented 3 years ago

Wow, that's remarkably different interpretations. I guess this is another reason we require implementations before release ;-)

Having a bar being 'actually' a marker is very unintuitive to me, but if clearly defined in the spec, it's at least unambiguous. I just can't see anyone coming to that conclusion unprompted, meaning that the spec would be misaligned with people's assumptions. Then again, this is supposed to be more for tool authors than the general public, so maybe tool author intuition is different than I expect.

matthiaskoenig commented 3 years ago

The main reason I saw them as marker is because I also want to encode the edge properties of the bars (linewidth and linecolor). The marker provides the complete set of information in addition to the color, so it made sense for me to just use the marker ;).

fbergmann commented 3 years ago

I would prefer lucians interpretation of the specification in the example here. For the box plots, the line would represent the outline of it (which is optional, in case you don't want to have one), and the fil represents how the inside is filled (and in case of secondColor shaded). I don't see a use of marker here.

matthiaskoenig commented 3 years ago

@luciansmith and @fbergmann I am fine with this interpretation. Then I will update my implementation accordingly and we have to add some clarification sentence to the specification how bar plots are styled.