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

Method MakeTimeCatScale

tests/unit/scale/ScaleController.h:86–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84 }
85
86 static bool MakeTimeCatScale() {
87 nlohmann::json data = {{{"field", "2017"}}};
88 nlohmann::json config = {{"type", "timeCat"}};
89 scale::ScaleController ctrl(nullptr);
90 auto coord = ScaleController::MakeCoord();
91 ctrl.UpdateColConfig("field", config);
92 auto &scale = ctrl.CreateScale("field", data, ScaleController::MakeTracer(), coord);
93 bool isCat = (*scale).GetType() == scale::ScaleType::TimeCat;
94
95 auto &cachedScale = ctrl.CreateScale("field", data, ScaleController::MakeTracer(), coord);
96 bool isCat2 = (*cachedScale).GetType() == scale::ScaleType::TimeCat;
97 return isCat && isCat2;
98 }
99
100 static bool MakeTimeSharingLinearScale() {
101 nlohmann::json config = {{"type", "timeSharing"}};

Callers

nothing calls this directly

Calls 2

UpdateColConfigMethod · 0.80
GetTypeMethod · 0.45

Tested by

no test coverage detected