Skip to content
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

Don't apply width for popup graphs #458

Merged
merged 1 commit into from
Mar 8, 2019
Merged

Conversation

aalwash
Copy link
Contributor

@aalwash aalwash commented Mar 8, 2019

In extension of this PR #443

This also fixes #424
The graph configuration also applies for popups (except for width)

@aalwash
Copy link
Contributor Author

aalwash commented Mar 8, 2019

@paalkr I checked the code, the graphTypes already applies for popup graphs

This PR only fixes that the width in the configuration doesn't apply for the graph popup

@robgeerts robgeerts merged commit ea43605 into Dashticz:beta Mar 8, 2019
@paalkr
Copy link

paalkr commented Mar 11, 2019

@aalwash , how is the graphTypes applied to a popup graph? I have not succeeded achieving this.

@aalwash
Copy link
Contributor Author

aalwash commented Mar 12, 2019

Can you show me your config? It should work like mentioned in #443
So:

blocks['graph_idx'] = {
    title: 'Outside (temperature only)',
    width: 6,
    graphTypes: ['te']
};

The graphType applies for normal graphs, but also works for popup graphs

@paalkr
Copy link

paalkr commented Mar 12, 2019

Well, the thing is that when I use this config

blocks['graph_567'] = {
    title: 'Utetemperatur',
    width: 6,
    graphTypes: ['te'],
    hide_title: true,
    last_update: true
};
columns['Main_c_3']['blocks'] = [
								'graph_567',568,
								569,
								'567_2','572_3'
								];	

I get this correct result
image

But I would like to have this as a button like this
image
Which I can get by adding this config

blocks['567_1'] = {
    title: 'Utetemperatur',
    width: 6,
    graphTypes: ['te'],
    hide_title: true,
    last_update: true
};
columns['Main_c_3']['blocks'] = [
								'567_1',568,
								569,
								'567_2','572_3'
								];

And when I click that button, this popup is displayed, with both temperature (green line) and humidity (red line) added.
image

@paalkr
Copy link

paalkr commented Mar 12, 2019

I think also one of the problems is that you can use a different notations for blocks when you refer them in a column (idx, 'graph_idx', 'idx_1','idx_n'), even if you just defined the block as.
blocks[idx]

If I use this config I actually get what I want, except clicking the 567_2 block (humidity), actually brings up the same temperature graph as clicking the 567_1 block.

blocks['567_1'] = {
    title: 'Utetemperatur',
    width: 6,
    hide_title: true,
    last_update: true
};
blocks['graph_567'] = {
    title: 'Utetemperatur',
    width: 6,
    graphTypes: ['te'],
    hide_title: true,
    last_update: true
};
blocks['567_2'] = {
    title: 'Luftfuktighet',
    width: 6,
    last_update: true
};
columns['Main_c_3'] = {
    width: 4,
    blocks: ['567_1','567_2']
};

What I actually would like to do, is to use this notation and still get subtype filters applied to the graph popups. The value and title on the blocks does honor this configuration.
image

blocks['567_1'] = {
    title: 'Utetemperatur',
    width: 6,
    hide_title: true,
    last_update: true
};
blocks['567_2'] = {
    title: 'Luftfuktighet',
    width: 6,
    last_update: true
};
columns['Main_c_3'] = {
    width: 4,
    blocks: ['567_1','567_2]
};

And to make it even more confusing, you could actually do something like this, which is also a valid config. But title make less sense, hide_tile is not honored and graphTypes is not honored (which wouldn't have made any sense anyway in this config).

blocks[567] = {
    title: 'Utetemperatur',
    width: 6,
    graphTypes: ['te'],
    hide_title: true,
    last_update: true
};
columns['Main_c_3'] = {
    width: 4,
    blocks: ['567_1','567_2']
};

And even this is a valid config, graphTypes is not honored. Which would make less sense for the 567_2 block in the column def.

blocks[567] = {
    title: 'Utetemperatur',
    width: 6,
    graphTypes: ['te'],
    hide_title: true,
    last_update: true
};
columns['Main_c_3'] = {
    width: 4,
    blocks: ['graph_567','567_2']
};

This config will not work for the 567_2 block added to the column. The graph_567 block will be rendered correctly, honoring the graphTypes (only temperature plots are added to the graph).

blocks['graph_567'] = {
    title: 'Utetemperatur',
    width: 6,
    graphTypes: ['te'],
    hide_title: true,
    last_update: true
};
columns['Main_c_3'] = {
    width: 4,
    blocks: ['graph_567','567_2']
};

So to say it mildly. This is not user friendly, consistent nor clever designed. Maintaining and understanding the source code becomes hard for anybody but the author - maybe.

@aalwash
Copy link
Contributor Author

aalwash commented Mar 15, 2019

So to say it mildly. This is not user friendly, consistent nor clever designed. Maintaining and understanding the source code becomes hard for anybody but the author - maybe.

I totally agree, I did some digging in the code, it isn't easy to fix this problem :(
Unfortunately poorly designed code

It needs more research to understand how this code works...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants