xsheetjs/bits/54_drawing.js
SheetJS b7c0b0d914 fixed flow typecheck
- update FilterDatabase defined name when writing AutoFilter
- XLML stub cells have blank Data block
- HTML export honor `id` option
- expose `sheet_get_cell`
2019-10-31 23:09:14 -04:00

24 lines
849 B
JavaScript

/* 20.5 DrawingML - SpreadsheetML Drawing */
RELS.IMG = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
RELS.DRAW = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing";
/* 20.5.2.35 wsDr CT_Drawing */
function parse_drawing(data, rels/*:any*/) {
if(!data) return "??";
/*
Chartsheet Drawing:
- 20.5.2.35 wsDr CT_Drawing
- 20.5.2.1 absoluteAnchor CT_AbsoluteAnchor
- 20.5.2.16 graphicFrame CT_GraphicalObjectFrame
- 20.1.2.2.16 graphic CT_GraphicalObject
- 20.1.2.2.17 graphicData CT_GraphicalObjectData
- chart reference
the actual type is based on the URI of the graphicData
TODO: handle embedded charts and other types of graphics
*/
var id = (data.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1];
return rels['!id'][id].Target;
}