Closed aalwash closed 5 years ago
@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
@aalwash , how is the graphTypes applied to a popup graph? I have not succeeded achieving this.
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
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
But I would like to have this as a button like this 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.
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.
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.
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...
In extension of this PR https://github.com/Dashticz/dashticz_v2/pull/443
This also fixes https://github.com/Dashticz/dashticz_v2/issues/424 The graph configuration also applies for popups (except for width)