"use strict";(self.webpackChunktiled=self.webpackChunktiled||[]).push([[356],{91697:function(e,n,t){t(72791);var a=t(54535),r=t(64554),i=t(68096),s=t(47071),l=t(30829),o=t(23786),c=t(80184);n.Z=function(e){var n=Array.from(Array(e.npartitions).keys());return(0,c.jsx)(r.Z,{children:(0,c.jsxs)(i.Z,{sx:{my:2},children:[(0,c.jsx)(l.Z,{id:"partition-select-helper-label",children:"Partition"}),(0,c.jsx)(a.Z,{labelId:"partition-select-label",id:"partition-select",value:e.value,label:"Partition",onChange:function(n){e.setValue(n.target.value)},children:n.map((function(e){return(0,c.jsx)(o.Z,{value:e,children:e},"partition-".concat(e))}))}),(0,c.jsx)(s.Z,{children:"A portion of the rows"})]})})}},36356:function(e,n,t){t.r(n);var a=t(1413),r=t(15861),i=t(70885),s=t(87757),l=t.n(s),o=t(72791),c=t(54535),u=t(94070),d=t(64554),h=t(91697),m=t(26445),f=t(20393),p=t(68096),x=t(47071),Z=t(30829),j=t(23786),b=t(20890),g=t(46348),v=t(16871),w=t(80184),y=function(e){var n=(0,v.s0)();return(0,w.jsx)(d.Z,{children:(0,w.jsxs)(p.Z,{children:[(0,w.jsx)(Z.Z,{id:"column-select-helper-label",children:"Go to Column"}),(0,w.jsx)(c.Z,{labelId:"column-select-label",id:"column-select",value:"",label:"Column",onChange:function(t){var a=t.target.value;n("/browse".concat(e.segments.map((function(e){return"/"+e})).join(""),"/").concat(a))},children:e.columns.map((function(e){return(0,w.jsx)(j.Z,{value:e,children:e},"column-".concat(e))}))}),(0,w.jsx)(x.Z,{children:"Access a single column as an Array."})]})})},k=function(e){var n=o.useState(10),t=(0,i.Z)(n,2),r=t[0],s=t[1],l=e.columns.map((function(e){return{field:e,headerName:e,width:200}})),c=e.rows.map((function(e,n){return e.id=n,e}));return(0,w.jsx)(f._$r,(0,a.Z)((0,a.Z)({},e.loading?{loading:!0}:{}),{},{rows:c,columns:l,pagination:!0,pageSize:r,rowsPerPageOptions:[10,30,100],onPageSizeChange:function(e){return s(e)},autoHeight:!0}))};n.default=function(e){var n=e.item.data.attributes.structure.macro.npartitions,t=(0,o.useState)(0),a=(0,i.Z)(t,2),s=a[0],c=a[1],f=(0,o.useState)([]),p=(0,i.Z)(f,2),x=p[0],Z=p[1],j=(0,o.useState)(!1),v=(0,i.Z)(j,2),C=v[0],S=v[1],A=e.item.data.attributes.structure.macro.columns;(0,o.useEffect)((function(){var n=new AbortController,t=e.item.data.links.partition.replace("{index}",s);function a(){return a=(0,r.Z)(l().mark((function e(){var a,r;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,g.be.get("".concat(t,"&format=application/json-seq"),{signal:n.signal});case 2:a=e.sent,r=a.data.split("\n").map((function(e){return JSON.parse(e)})),Z(r),S(!0);case 6:case"end":return e.stop()}}),e)}))),a.apply(this,arguments)}return function(){a.apply(this,arguments)}(),function(){n.abort()}}),[e.segments,e.item.data.links.full,e.item.data.links.partition,s]);return(0,w.jsx)(d.Z,{sx:{my:4},children:(0,w.jsxs)(m.Z,{maxWidth:"lg",children:[(0,w.jsx)(y,{segments:e.segments,columns:A}),(0,w.jsxs)(d.Z,{width:"100%",mt:5,children:[(0,w.jsx)(b.Z,{id:"table-title",variant:"h6",component:"h2",children:"Table"}),n>1?(0,w.jsxs)(d.Z,{children:[(0,w.jsxs)(u.Z,{severity:"info",children:["This large dataframe available in ",(0,w.jsx)("em",{children:"partitions"})," (chunks of rows) because the full dataframe may be slow to download and display.",(0,w.jsx)("br",{}),'In the "Download" tab, you can request the full table as a single file if you wish.']}),(0,w.jsx)(h.Z,{npartitions:n,value:s,setValue:function(e){Z([]),S(!1),c(e)}})]}):"",(0,w.jsx)(k,{rows:x,columns:A,loading:!C})]})]})})}}}]);
//# sourceMappingURL=356.dce655c0.chunk.js.map