3 lines
5.1 KiB
JavaScript
3 lines
5.1 KiB
JavaScript
import{p as r,f as T,a as y,c as u}from"./props-b4vEeO_8.js";import{o as E,a as G}from"./index-client-BAw8T8-V.js";import{G as B,B as F,C as f,F as g,I as q,J as I}from"./runtime-C3rQLW--.js";import{i as k}from"./svelte-component-C8Ginrj8.js";import{s as h}from"./snippet-C5kbqVpq.js";import{s as l}from"./attributes-Cg6aLqN3.js";import{b as J}from"./this-CrUBQEQ_.js";import{G as M}from"./GraphicBlock-uLJTqaY1.js";var N=T('<!> <div class="datawrapper-chart"><iframe frameborder="0" data-chromatic="ignore" style="width: 0; min-width: 100% !important; border: none;"></iframe></div> <!>',1);function P(v,t){F(t,!0);let x=r(t,"frameTitle",3,""),b=r(t,"ariaLabel",3,""),_=r(t,"id",3,""),S=r(t,"scrolling",3,"no"),C=r(t,"width",3,"normal"),D=r(t,"textWidth",3,"normal"),p;const w=n=>{if(n.data["datawrapper-height"]!==void 0){const d=[p];for(const o in n.data["datawrapper-height"])for(let i=0;i<d.length;i++)d[i].contentWindow===n.source&&(d[i].style.height=n.data["datawrapper-height"][o]+"px")}};E(()=>{typeof window<"u"&&window.addEventListener("message",w)}),G(()=>{typeof window<"u"&&window.removeEventListener("message",w)}),M(v,{get width(){return C()},get textWidth(){return D()},get title(){return t.title},get description(){return t.description},get notes(){return t.notes},children:(n,d)=>{var o=N(),i=f(o);{var L=e=>{var s=u(),c=f(s);h(c,()=>t.titleSnippet),y(e,s)};k(i,e=>{t.titleSnippet&&e(L)})}var m=g(i,2),a=q(m);J(a,e=>p=e,()=>p);var V=g(m,2);{var W=e=>{var s=u(),c=f(s);h(c,()=>t.notesSnippet),y(e,s)};k(V,e=>{t.notesSnippet&&e(W)})}I(()=>{l(a,"title",x()),l(a,"aria-label",b()),l(a,"id",_()),l(a,"src",t.src),l(a,"scrolling",S())}),y(n,o)},$$slots:{default:!0}}),B()}P.__docgen={data:[{name:"title",visibility:"public",description:"Title of the graphic",keywords:[],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1},{name:"description",visibility:"public",description:"Description of the graphic, passed in as a markdown string.",keywords:[],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1},{name:"frameTitle",visibility:"public",description:"iframe title",keywords:[],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1,defaultValue:'""'},{name:"notes",visibility:"public",description:"Notes to the graphic, passed in as a markdown string.",keywords:[],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1},{name:"ariaLabel",visibility:"public",description:"iframe aria label",keywords:[],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1,defaultValue:'""'},{name:"id",visibility:"public",keywords:[],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1,defaultValue:'""'},{name:"src",visibility:"public",description:"Datawrapper embed URL",keywords:[{name:"required",description:""}],kind:"let",type:{kind:"type",type:"string",text:"string"},static:!1,readonly:!1},{name:"scrolling",visibility:"public",description:"iframe scrolling option",keywords:[],kind:"let",type:{kind:"union",type:[{kind:"const",type:"string",value:"auto",text:'"auto"'},{kind:"const",type:"string",value:"yes",text:'"yes"'},{kind:"const",type:"string",value:"no",text:'"no"'}],text:'"auto" | "yes" | "no"'},static:!1,readonly:!1,defaultValue:'"no"'},{name:"width",visibility:"public",description:"Width of the chart within the text well.",keywords:[],kind:"let",type:{kind:"union",type:[{kind:"const",type:"string",value:"narrower",text:'"narrower"'},{kind:"const",type:"string",value:"narrow",text:'"narrow"'},{kind:"const",type:"string",value:"normal",text:'"normal"'},{kind:"const",type:"string",value:"wide",text:'"wide"'},{kind:"const",type:"string",value:"wider",text:'"wider"'},{kind:"const",type:"string",value:"widest",text:'"widest"'},{kind:"const",type:"string",value:"fluid",text:'"fluid"'}],text:'"narrower" | "narrow" | "normal" | "wide" | "wider" | "widest" | "fluid"'},static:!1,readonly:!1,defaultValue:'"normal"'},{name:"textWidth",visibility:"public",description:`Set a different width for the text within the text well, for example,
|
|
"normal" to keep the title, description and notes inline with the rest
|
|
of the text well. Can't ever be wider than \`width\`.`,keywords:[],kind:"let",type:{kind:"union",type:[{kind:"const",type:"string",value:"narrower",text:'"narrower"'},{kind:"const",type:"string",value:"narrow",text:'"narrow"'},{kind:"const",type:"string",value:"normal",text:'"normal"'},{kind:"const",type:"string",value:"wide",text:'"wide"'},{kind:"const",type:"string",value:"wider",text:'"wider"'},{kind:"const",type:"string",value:"widest",text:'"widest"'},{kind:"const",type:"string",value:"fluid",text:'"fluid"'}],text:'"narrower" | "narrow" | "normal" | "wide" | "wider" | "widest" | "fluid"'},static:!1,readonly:!1,defaultValue:'"normal"'},{name:"titleSnippet",visibility:"public",description:"Custom headline and chatter snippet",keywords:[],kind:"let",type:{kind:"function",text:"Snippet<[]>"},static:!1,readonly:!1},{name:"notesSnippet",visibility:"public",description:"Custom notes and source snippet",keywords:[],kind:"let",type:{kind:"function",text:"Snippet<[]>"},static:!1,readonly:!1}],name:"DatawrapperChart.svelte"};export{P as D};
|