import{r as e,H as p,G as u,a5 as x}from"./index.72e24882.js";import{S as i,D as E}from"./download-core.1ace673a.js";import{B as c}from"./browse.0916686d.js";import{T as d,P as h}from"./TextField.8d6efd58.js";import"./FormLabel.a3eda031.js";import"./Input.ed778d26.js";function y(){const[r,t]=e.exports.useState(null),s=o=>{t(o.currentTarget)},n=()=>{t(null)},a=Boolean(r),l=a?"examples":void 0;return e.exports.createElement("div",null,e.exports.createElement(x,{"aria-describedby":l,variant:"text",onClick:s},"Examples"),e.exports.createElement(h,{id:l,open:a,anchorEl:r,onClose:n,anchorOrigin:{vertical:"bottom",horizontal:"left"}},e.exports.createElement(c,{sx:{px:2,py:2}},"This supports basic multi-dimensional"," ",e.exports.createElement("strong",null,"numpy array slicing syntax"),". Examples for a 2-dimensional array:",e.exports.createElement("ul",null,e.exports.createElement("li",null,"First 50 elements along the first axis:",e.exports.createElement("pre",null,e.exports.createElement("code",null,":50"))),e.exports.createElement("li",null,"First 50 elements along the second axis:",e.exports.createElement("pre",null,e.exports.createElement("code",null,":,:50"))),e.exports.createElement("li",null,"A 50x10 section from the bottom right",e.exports.createElement("pre",null,e.exports.createElement("code",null,"-50:,-10:"))),e.exports.createElement("li",null,"Downsample the first and second axis by 2:"," ",e.exports.createElement("pre",null,e.exports.createElement("code",null,"::2,::2")))),"Also see this"," ",e.exports.createElement("a",{href:"https://www.w3schools.com/python/numpy/numpy_array_slicing.asp",target:"_blank",rel:"noreferrer"},"beginner tutorial"),".")))}const C=r=>{const[t,s]=e.exports.useState(),[n,a]=e.exports.useState("");var l;t!==void 0?(l=`${r.link}?format=${t.mimetype}`,n&&(l=l.concat(`&slice=${n}`))):l="";const o=m=>{a(m.target.value.replaceAll(" ",""))};return e.exports.createElement(c,null,e.exports.createElement(i,{spacing:2,direction:"column"},e.exports.createElement(p,null,"Dimensions: ",r.structure.shape.join(" \xD7 ")),e.exports.createElement(i,{spacing:1,direction:"row"},e.exports.createElement(d,{label:"Slice (Optional)",helperText:"If blank, access entire array",variant:"outlined",value:n,size:"medium",onChange:o}),e.exports.createElement(y,null)),e.exports.createElement(E,{name:r.name,format:t,setFormat:s,structureFamily:r.structureFamily,link:l}),t!==void 0&&(t.mimetype.startsWith("image/")||t.mimetype.startsWith("text/"))&&r.structure.shape.length!==2?e.exports.createElement(u,{sx:{mt:2},severity:"warning"},"This is a multidimensional array. It may be necessary to slice a portion of this array to successfully export it as an image or textual format."):""))};export{C as default};
