MCPcopy Create free account
hub / github.com/GeoDaCenter/geoda / update

Method update

Explore/WebViewExampleWin.cpp:628–670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626}
627
628void WebViewExampleDlg::update(HLStateInt* o)
629{
630 LOG_MSG("Entering WebViewExampleDlg::update(HLStateInt*)");
631 if (o->GetEventType() == HLStateInt::empty) return;
632
633 wxString js_method = "gda.update";
634 wxString s;
635 s << js_method << "({";
636 s << "\"observable\": \"HighlightState\",\n";
637 s << "\"event\": \"" << o->GetEventTypeStr() << "\"";
638 if (o->GetEventType() == HLStateInt::delta) {
639 s << ",\n";
640 s << "\"newly_highlighted\": [";
641 std::vector<int>& nh = o->GetNewlyHighlighted();
642 for (size_t i=0, sz=o->GetTotalNewlyHighlighted(); i<sz; ++i) {
643 s << nh[i];
644 if (i+1 < sz) s << ",";
645 }
646 s << "],\n";
647 s << "\"newly_unhighlighted\": [";
648 std::vector<int>& nuh = o->GetNewlyUnhighlighted();
649 for (size_t i=0, sz=o->GetTotalNewlyUnhighlighted(); i<sz; ++i) {
650 s << nuh[i];
651 if (i+1 < sz) s << ",";
652 }
653 s << "]";
654 }
655 s << "});";
656
657
658 /*
659 gda.update({"update": "HighlightState",
660 "event": "delta",
661 "newly_highlighted": [3,2,32,4],
662 "newly_unhighlighted": [23, 6, 7]
663 };
664 */
665
666 //LOG_MSG(s);
667 web_view->RunScript(s);
668
669 LOG_MSG("Exiting WebViewExampleDlg::update(HLStateInt*)");
670}
671
672void WebViewExampleDlg::update(FramesManager* o)
673{

Callers

nothing calls this directly

Calls 9

GetCurrTimeMethod · 0.80
GetCurrTimeStringMethod · 0.80
GetWManIntMethod · 0.80
GetEventTypeMethod · 0.45
GetEventTypeStrMethod · 0.45
GetWeightsIdMethod · 0.45
GetTitleMethod · 0.45

Tested by

no test coverage detected