MCPcopy Create free account
hub / github.com/antvis/F2Native / InvokeRender

Method InvokeRender

core/bridge/ChartBridge.cpp:130–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130bool ChartBridge::InvokeRender(const nlohmann::json &dsl, const nlohmann::json &itemPosition,
131 BridgeCallback callback) {
132 chart_->Clear();
133 chart_->SetRequestFrameFuncId(requestFrameFuncId_);
134 chart_->SetInvokeFunction(&commonFunction_);
135 if (!chart_->ParseObject(dsl)) {
136 CallbackError("render", callback, "parse dsl error");
137 return false;
138 }
139
140 //业务需要的额外字段解析,会覆盖之前的设置
141 CompatScales(dsl);
142 CompatToolTip(callback);
143
144 //渲染
145 if (chart_->Render()) {
146 railing_->Swap();
147
148 CallbackSuccess("render", callback, GetPosition(itemPosition), chart_->GetRenderCmdCount(),
149 chart_->GetRenderDurationMM());
150 return true;
151 } else {
152 CallbackError("render", callback, "render error");
153 return false;
154 }
155}
156
157void ChartBridge::CompatToolTip(BridgeCallback callback) {
158 if (!needToolTip_) {

Callers

nothing calls this directly

Calls 8

SetRequestFrameFuncIdMethod · 0.80
SetInvokeFunctionMethod · 0.80
ParseObjectMethod · 0.80
SwapMethod · 0.80
GetRenderCmdCountMethod · 0.80
GetRenderDurationMMMethod · 0.80
ClearMethod · 0.45
RenderMethod · 0.45

Tested by

no test coverage detected