-
Notifications
You must be signed in to change notification settings - Fork 81
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
Axis refactor v12 - Separate AxisChannel properties from Channel properties #613
base: main
Are you sure you want to change the base?
Conversation
@@ -76,6 +76,12 @@ definitions: | |||
oneOf: | |||
- type: number | |||
- { type: string, enum: [auto] } | |||
|
|||
AxisChannel: | |||
description: | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Channel props can be inherited:
$extends: Channel
@@ -109,14 +115,18 @@ definitions: | |||
type: object | |||
properties: | |||
x: | |||
$ref: Channel | |||
allOf: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for allOf
if AxisChannel
inherits Channel
properties
@@ -118,9 +118,22 @@ struct ChannelSeriesList | |||
bool removeSeries(const Data::SeriesIndex &index); | |||
}; | |||
|
|||
class Channel | |||
struct AxisChannelProperties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make sense if instead of AxisChannelProperties
, we had an AxisChannel
derived from Channel
?
@@ -15,6 +15,7 @@ namespace Vizzu::Gen | |||
struct Channels : Refl::EnumArray<ChannelId, Channel> | |||
{ | |||
using IndexSet = std::set<Data::SeriesIndex>; | |||
EnumArray<AxisId, AxisChannelProperties> axisProps; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't something like this would be more straight forward:
struct Channels
{
Refl::EnumArray<NonAxisId, Channel> nonAxisChannels;
EnumArray<AxisId, AxisChannel /* inherits Channel */> axisChannels;
No description provided.