aboutsummaryrefslogtreecommitdiff
path: root/barchart.h
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-01-26 18:15:50 +0100
committerSamuel Fadel <samuelfadel@gmail.com>2016-01-26 18:15:50 +0100
commit41e1b2bfb8e2ba3d0e74180200e7cc109171213e (patch)
tree27c7dbaa8fcdcc7efb300c0ea0a44b28d2ac76c0 /barchart.h
parent7f0f945c35bc8c12d55efbce7545995fc76892c1 (diff)
Scatterplot & BarChart: initial brushing mechanism.
* Both components now support brushing (support in Scatterplot for activating a brush is still incomplete, though it can be brushed on by other components) * Added a handler for linking the brushing between components * Added crosshair geometry handler to geometry lib * Fixed issue #15
Diffstat (limited to 'barchart.h')
-rw-r--r--barchart.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/barchart.h b/barchart.h
index d49c001..e9de96d 100644
--- a/barchart.h
+++ b/barchart.h
@@ -23,11 +23,14 @@ signals:
void colorScaleChanged(const ColorScale &scale) const;
void selectionChanged(const std::vector<bool> &selection) const;
void selectionInteractivelyChanged(const std::vector<bool> &selection) const;
+ void itemBrushed(int item) const;
+ void itemInteractivelyBrushed(int item) const;
public slots:
void setValues(const arma::vec &values);
void setColorScale(const ColorScale &scale);
void setSelection(const std::vector<bool> &selection);
+ void brushItem(int item);
protected:
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *);
@@ -48,9 +51,9 @@ private:
void updateBarNodeGeom(QSGNode *barNode, float x, float width, float height);
void updateBarNodeColor(QSGNode *barNode, const QColor &color);
void updateBars(QSGNode *node);
- void updateHoverHints(QSGNode *node);
+ void updateBrush(QSGNode *node);
bool m_shouldUpdateBars;
- float m_hoverPos;
+ int m_brushedItem;
void updateSelectionRect(QSGNode *node);
bool m_shouldUpdateSelectionRect;
@@ -62,7 +65,7 @@ private:
arma::vec m_values;
ColorScale m_colorScale;
- std::vector<int> m_originalIndices;
+ std::vector<int> m_originalIndices, m_currentIndices;
LinearScale<float> m_scale;
};