(actionLayer, scene)
| 1920 | } |
| 1921 | |
| 1922 | function addL7MarkerLayer(actionLayer, scene) { |
| 1923 | const { source, id: markerLayerId, chartType } = actionLayer; |
| 1924 | let data = source.data; |
| 1925 | if (actionLayer.filter) { |
| 1926 | data = filterMarkerData(source.data, actionLayer.filter); |
| 1927 | } |
| 1928 | removeL7MarkerLayer(markerLayerId, scene); |
| 1929 | let markers = []; |
| 1930 | if (chartType === StyleRenderType.bar) { |
| 1931 | const { fields, width, height, background, xAxis, yAxis } = actionLayer; |
| 1932 | const chartSettings = { |
| 1933 | width: width.values, |
| 1934 | height: height.values, |
| 1935 | background: background.values, |
| 1936 | xAxis: xAxis.values, |
| 1937 | yAxis: yAxis.values |
| 1938 | }; |
| 1939 | markers = getL7ChartBarMarkerLayer(fields.values, chartSettings, data); |
| 1940 | } |
| 1941 | if (chartType === StyleRenderType.line) { |
| 1942 | const { color, fields, width, height, background, xAxis, yAxis } = actionLayer; |
| 1943 | const chartSettings = { |
| 1944 | width: width.values, |
| 1945 | height: height.values, |
| 1946 | background: background.values, |
| 1947 | xAxis: xAxis.values, |
| 1948 | yAxis: yAxis.values, |
| 1949 | color: color.values |
| 1950 | }; |
| 1951 | markers = getL7ChartLineMarkerLayer(fields.values, chartSettings, data); |
| 1952 | } |
| 1953 | if (chartType === StyleRenderType.pie) { |
| 1954 | const { fields, radius, innerRadius } = actionLayer; |
| 1955 | const chartSettings = { |
| 1956 | radius: radius.values, |
| 1957 | innerRadius: innerRadius.values |
| 1958 | }; |
| 1959 | markers = getL7ChartPieMarkerLayer(fields.values, chartSettings, data); |
| 1960 | } |
| 1961 | const layer = createL7MarkerLayerByMarkers(markers); |
| 1962 | scene.addMarkerLayer(layer); |
| 1963 | ChartController.setMarkerLayer(markerLayerId, layer); |
| 1964 | return layer; |
| 1965 | } |
| 1966 | |
| 1967 | function getL7Layer(l, sourceInfo) { |
| 1968 | const typeRule = { |
no test coverage detected