JS API Supported by FVS Dashboard

  • Last update:February 23, 2022
  • I. Overview

    Applicable scenarios: Users who have installed the "FVS Large Screen Editing Mode" plugin can refer to this article to learn about the related functions of the FVS template.

    1. Version

    Report server version
    JAR packageFVS large screen editing mode (beta version) version
    11.02021-11-15V1.0.0


    2. Function introduction

    The FVS large screen template supports the use of JavaScript code to trigger interaction effects such as linkage and jump.

    This article will describe where the JavaScript code is used and the supported interfaces.

    II. Where to use

    There are four places where JavaScript code is supported

    1. Page After-load Event

    On the FVS canvas editing page, select Template > Page After-load Event in the menu bar, and you can enter JavaScript code to take effect for the entire FVS large screen template.

    1.png


    2. Table After-load Event

    In the table component (fast version)/table component editing area, select Template > Table After-load Event in the menu bar, and you can enter JavaScript code to take effect for the table component.

    2.png

    It should be noted that in the table component, the "table after-load event" cannot be passed to the outer FVS template. If it must be passed, add parent.window before the code.

    For example, to set the toggle pagination event in the interactive click event of the title component, the code is:

    duchamp.switchStory("Page1");

    And in the table aftr-load event of the table component, set the switching pagination event, the code is:

    parent.window.duchamp.switchStory("Page1");


    3. Interaction - click event

    Select a single component and click Interaction > Clickin the configuration bar to support the new JavaScript type of click event. The event takes effect when the specified content within this component/component is clicked.

    Note: The following components do not support JavaScript type click events:

    Rich text component, table component, carousel component, iFrame component, local video component, local monitoring component

    Carousel Pie Chart, Carousel Luminous Gauge, Water Polo, Waffle Chart, Carousel KPI Card(Flashing), Carousel KPI Card(Electronic), Carousel Catalog Gear, Carousel 3D Combination Map, Carousel GIS Point Map, Carousel Bar Chart, Arc Column Chart, Particle Counter, Flow on Global, Time Gear

    3.png


    4. Interaction - Carousel Events

    Select a single component and click Interaction > Carouselin the configuration bar to support the new JavaScript type of carousel events. The event takes effect when the specified content within this component/component rotates.

    Note: Only the following components support JavaScript type carousel events:

    Scene Switching map, Carousel component, Fancy Tree(Electronic), Fancy Tree(Model), Carousel pie chart, Carousel Luminous Gauge, Water Polo, Waffle Chart, Carousel KPI Card(Flashing), Carousel KPI Card(Electronic), Carousel Catalog Gear, Carousel 3D Combination Map, Carousel GIS Point Map

    4.png

    III. Supported Interfaces

    The JavaScript function is a beta function and only supports the JS interface provided in this article.

    ScenesIntroductionExample
    Page refresh

    FVS preview page refreshes automatically after a period of time;

    Or FVS triggers a refresh at a fixed time every day

    setInterval(() => {
        duchamp.reload();
      }, 2 * 1000);
    Report block auto scroll

    Report block marquee effect, support circular scrolling

    Can only be used in the table after-load event

    1) Table(Fast Version) Component:

    Start Marquee:

    setTimeout(() => {
            duchamp.getWidgetByName("Table").startMarquee()        
    }, 500)

    Stop Marquee:

    setTimeout(() => {
            duchamp.getWidgetByName("Table").stopMarquee()        
    }, 500)

    2) Table Component:

    Start Marquee: _g().startMarquee();

    Stop Marquee: _g().startMarquee();

    Chart data point hint carousel

    Chart data point hint carousel

    For details, see:Chart data tooltip auto display

    duchamp.on("storychange", (current) => {
      if (current === "Page2") {
        duchamp.getWidgetByName("Component1").openAutoTooltip();
      }
    });
    Sound alarm

    When a certain condition is met, such as a parameter value > 100, a sound prompt will be triggered

    For details, see:JS Sound Alert for Data Entry

    const audio = document.createElement("audio");
      audio.src = "./assets/internal/demo/5196.mp3";
      audio.loop = true;
      document.body.appendChild(audio);


      const interval = setInterval(() => {
        const widget = duchamp.getWidgetByName("组件1");
        if (widget.getParameters("abc") > 100) {
          audio.play();
          clearInterval(interval);
        }
      }, 2000);
    Trigger component linkage/refreshTrigger the refresh or linkage effect of a componentRefresh:

    duchamp.getWidgetByName("Component1").refresh();

    Linkage:

    duchamp.getWidgetByName("Component1").trigger();

    Trigger page full screen

    Trigger FVS page full screen

    The browser does not allow direct full screen, it must be operated by the user, so this JS can be used in the interactive JS of the component

    duchamp.requestFullscreen();
    Jump to the specified pageJS of jumping to the specified page

    duchamp.switchStory("Page4");//Jump to the Page4

    duchamp.nextStory();//Jump to the next page

    duchamp.previousStory();//Jump to the previous page

    Get 3D city data layer

    Get 3D city data layers, hide/show layers

    For details, see:FVS click hide/show data layer

    duchamp.getWidgetByName("3D city name").getDataLayers() //Obtain all data layers of a 3D city

    duchamp.getWidgetByName("3D city name").getDataLayerByName("layer1"); //Get the layer with the specified name of the 3D city


    Attachment List


    Theme: Rachel
    Already the First
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy