| 123 | } |
| 124 | |
| 125 | bool interaction::InteractionContext::Repaint(nlohmann::json &newValues, std::size_t valueStart, std::size_t valueEnd) { |
| 126 | const std::string &xField = this->chart_->GetXScaleField(); |
| 127 | auto &scale = this->chart_->GetScale(xField); |
| 128 | |
| 129 | if(util::isEqualsQuick(scale.values, newValues)) |
| 130 | return false; |
| 131 | |
| 132 | // chart_->GetLogTracer()->trace("Repaint range: %lu", (valueEnd - valueStart)); |
| 133 | // TODO 平移或者缩放过程中,ticks 的变化应该由每个度量自行决定。 逻辑暂时保持 ticks 不变 |
| 134 | UpdateScale(xField, {{"ticks", scale.ticks}, {"domain", {valueStart, valueEnd}}}); |
| 135 | UpdateFollowScale(scale, newValues, valueStart, valueEnd); |
| 136 | this->chart_->Repaint(); |
| 137 | return true; |
| 138 | } |
| 139 | |
| 140 | void interaction::InteractionContext::UpdateFollowScale(scale::AbstractScale &pinchScale, |
| 141 | nlohmann::json &pinchValues, |
no test coverage detected