File tree Expand file tree Collapse file tree
src/main/resources/static/js/widgets Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ export default class StaticIFrame {
2+ static defaultConfig = {
3+ type : "StaticIFrame" ,
4+ title : "Inline Frame" ,
5+ src : "https://example.com/" ,
6+ options : { } ,
7+ icon : "bi bi-window" ,
8+ w : 8 ,
9+ h : 6 ,
10+ } ;
11+ static formConfig = {
12+ title : {
13+ type : "text" ,
14+ label : "Tooltip" ,
15+ } ,
16+ src : {
17+ type : "text" ,
18+ label : "URL" ,
19+ } ,
20+ } ;
21+
22+ constructor ( root , config ) {
23+ this . root = d3 . select ( root ) ;
24+ this . config = config ;
25+
26+ this . src = config . src || "" ;
27+ }
28+
29+ clear ( ) {
30+ this . root . select ( "iframe" ) . remove ( ) ;
31+ }
32+
33+ init ( ) {
34+ this . render ( this . src ) ;
35+ }
36+
37+ render ( data ) {
38+ this . clear ( ) ;
39+
40+ this . root
41+ . append ( "iframe" )
42+ . attr ( "src" , data )
43+ . attr ( "width" , "100%" )
44+ . attr ( "height" , "100%" ) ;
45+
46+ this . root . classed ( "overflow-hidden" , true ) ;
47+ }
48+ }
Original file line number Diff line number Diff line change 11import StaticImage from "./static/StaticImage.js" ;
22import StaticText from "./static/StaticText.js" ;
33import StaticVideo from "./static/StaticVideo.js" ;
4+ import StaticIFrame from "./static/StaticIFrame.js" ;
45
56import BarChart from "./charts/BarChart.js" ;
67import LineChart from "./charts/LineChart.js" ;
@@ -16,6 +17,7 @@ export default {
1617 StaticText,
1718 StaticImage,
1819 StaticVideo,
20+ StaticIFrame,
1921
2022 BarChart,
2123 PieChart,
You can’t perform that action at this time.
0 commit comments