ooxml_parser 0.7.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart.rb +55 -48
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/plot_area/common_chart_data.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/number_string_cache.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis.rb +6 -10
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_axis_title.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_legend.rb +4 -6
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb +4 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/docx_drawing.rb +2 -21
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_drawing_properties.rb +51 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/docx_wrap_drawing.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/ooxml_coordinates.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/ooxml_text_box.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style.rb +0 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/effect_reference.rb +0 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/fill_reference.rb +0 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/font_reference.rb +0 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/shape_style/line_reference.rb +0 -4
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/text_body.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/color/docx_color_scheme.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path/docx_shape_line_element.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/ooxml_custom_geometry.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_line.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb +13 -3
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties/preset_geometry/shape_adjust_value_list.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb +10 -3
- data/lib/ooxml_parser/common_parser/common_data/alternate_content/picture/group/old_docx_group.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/borders_properties.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/color.rb +15 -81
- data/lib/ooxml_parser/common_parser/common_data/color/color_helper.rb +33 -3
- data/lib/ooxml_parser/common_parser/common_data/color/color_indexes.list +66 -0
- data/lib/ooxml_parser/common_parser/common_data/colors/color_properties.rb +8 -2
- data/lib/ooxml_parser/common_parser/common_data/colors/hsl_color.rb +0 -33
- data/lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/colors/presentation_fill/gradient_color.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/colors/theme_colors.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/colors/tile.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/content_types.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/hyperlink.rb +15 -4
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object.rb +5 -1
- data/lib/ooxml_parser/common_parser/common_data/paragraph.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_properties.rb +2 -4
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties.rb +31 -9
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/outline.rb +5 -3
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/shade.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/relationships.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/table.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/table/margins/paragraph_margins.rb +1 -5
- data/lib/ooxml_parser/common_parser/common_data/table/margins/table_margins.rb +2 -2
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_look.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/cell.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/grid_span.rb +1 -7
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/table_cell_line.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/table/row/row.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/table/table_grid.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/table/table_properties.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_data/underline.rb +4 -3
- data/lib/ooxml_parser/common_parser/common_data/valued_child.rb +1 -1
- data/lib/ooxml_parser/common_parser/common_document_structure.rb +1 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure.rb +16 -8
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments.rb +2 -2
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments/comment.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/comments_extended.rb +2 -2
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_background.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_settings.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/document_style.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph.rb +7 -11
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/bar.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/box.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/delimeter.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/limit.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/math_run/math_run_properties.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/matrix/matrix_row.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_formula/radical.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/docx_paragraph_run_helpers.rb +38 -21
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/shape.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/docx_paragraph_run/text_outline.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/field_simple.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/indents.rb +3 -3
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/sdt/sdt_content.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/docx_paragraph/style_parametres.rb +5 -8
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/header_footer.rb +9 -3
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering.rb +2 -2
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level/suffix.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/columns.rb +4 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/note.rb +4 -2
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_margins.rb +1 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_properties.rb +1 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/page_size.rb +2 -1
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/styles.rb +2 -2
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/comment_authors.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comments.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme.rb +1 -0
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_theme/theme_color.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide.rb +3 -3
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/background.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/common_slide_data/shape_tree.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/graphic_frame/graphic_frame.rb +2 -2
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/shapes_grouping.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/time_node/common_timing/condition_list.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide_helper.rb +1 -3
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition/sound_action/sound.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/table_styles.rb +1 -1
- data/lib/ooxml_parser/pptx_parser/pptx_parser.rb +1 -1
- data/lib/ooxml_parser/version.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook.rb +4 -3
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/chartsheet.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/shared_string_table.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs/cell_style/alignment.rb +5 -5
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/cell_xfs/xf.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fills.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/fonts/font.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/number_formats.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/style_sheet/xlsx_borders.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/comment_list.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/autofilter/filter_column/custom_filters.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/table_columns.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/xlsx_row/xlsx_cell.rb +1 -1
- metadata +99 -35
- data/lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/shape/non_visual_shape_properties/hyperlinks/hyperlink_for_hover.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 728a4727e30c90aebf48cd417a9865dbf3726719e08bd20403b558377311105d
|
4
|
+
data.tar.gz: b73f86cce58d63354209f84fbe9d496301acb3d3b5ae7973639912d87b85b599
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d985dddf15a50d7ec8796805009057f7149a3958a24e735279a9fcdc622156c1837662a56947a841d68958ac5eedb9afae7947eba48cf8929941def9e34c1832
|
7
|
+
data.tar.gz: '08ded5794f5a0745ee001b0a993d82c5790eb058d49436149ea13f65ebcd650da8e64cbbc9f8949a705a985d20b3e5d34f83552f264b441abd6a128923809013'
|
@@ -38,7 +38,7 @@ module OoxmlParser
|
|
38
38
|
@legend = nil
|
39
39
|
@axises = []
|
40
40
|
@series = []
|
41
|
-
|
41
|
+
super
|
42
42
|
end
|
43
43
|
|
44
44
|
# Parse properties of Chart
|
@@ -74,94 +74,101 @@ module OoxmlParser
|
|
74
74
|
extend Gem::Deprecate
|
75
75
|
deprecate :data, 'series points interface', 2020, 1
|
76
76
|
|
77
|
-
# Parse
|
78
|
-
# @param parent [OOOXMLDocumentObject] parent of chart
|
77
|
+
# Parse Chart data
|
79
78
|
# @return [Chart] result of parsing
|
80
|
-
def
|
81
|
-
|
82
|
-
chart_xml = chart.parse_xml(OOXMLDocumentObject.current_xml)
|
79
|
+
def parse
|
80
|
+
chart_xml = parse_xml(OOXMLDocumentObject.current_xml)
|
83
81
|
chart_xml.xpath('*').each do |chart_node|
|
84
82
|
case chart_node.name
|
85
83
|
when 'chartSpace'
|
86
84
|
chart_node.xpath('*').each do |chart_space_node_child|
|
87
85
|
case chart_space_node_child.name
|
88
86
|
when 'AlternateContent'
|
89
|
-
|
87
|
+
@alternate_content = AlternateContent.new(parent: self).parse(chart_space_node_child)
|
90
88
|
when 'spPr'
|
91
|
-
|
89
|
+
@shape_properties = DocxShapeProperties.new(parent: self).parse(chart_space_node_child)
|
92
90
|
when 'chart'
|
93
91
|
chart_space_node_child.xpath('*').each do |chart_node_child|
|
94
92
|
case chart_node_child.name
|
95
93
|
when 'plotArea'
|
96
94
|
chart_node_child.xpath('*').each do |plot_area_node_child|
|
97
|
-
next unless
|
95
|
+
next unless type.empty?
|
98
96
|
|
99
97
|
case plot_area_node_child.name
|
100
98
|
when 'barChart'
|
101
|
-
|
99
|
+
@type = :bar
|
102
100
|
bar_dir_node = plot_area_node_child.xpath('c:barDir')
|
103
|
-
|
104
|
-
|
101
|
+
@type = :column if bar_dir_node.first.attribute('val').value == 'col'
|
102
|
+
parse_properties(plot_area_node_child)
|
105
103
|
when 'lineChart'
|
106
|
-
|
107
|
-
|
104
|
+
@type = :line
|
105
|
+
parse_properties(plot_area_node_child)
|
108
106
|
when 'areaChart'
|
109
|
-
|
110
|
-
|
107
|
+
@type = :area
|
108
|
+
parse_properties(plot_area_node_child)
|
111
109
|
when 'bubbleChart'
|
112
|
-
|
113
|
-
|
110
|
+
@type = :bubble
|
111
|
+
parse_properties(plot_area_node_child)
|
114
112
|
when 'doughnutChart'
|
115
|
-
|
116
|
-
|
113
|
+
@type = :doughnut
|
114
|
+
parse_properties(plot_area_node_child)
|
117
115
|
when 'pieChart'
|
118
|
-
|
119
|
-
|
116
|
+
@type = :pie
|
117
|
+
parse_properties(plot_area_node_child)
|
120
118
|
when 'scatterChart'
|
121
|
-
|
122
|
-
|
119
|
+
@type = :point
|
120
|
+
parse_properties(plot_area_node_child)
|
123
121
|
when 'radarChart'
|
124
|
-
|
125
|
-
|
122
|
+
@type = :radar
|
123
|
+
parse_properties(plot_area_node_child)
|
126
124
|
when 'stockChart'
|
127
|
-
|
128
|
-
|
125
|
+
@type = :stock
|
126
|
+
parse_properties(plot_area_node_child)
|
129
127
|
when 'surface3DChart'
|
130
|
-
|
131
|
-
|
128
|
+
@type = :surface_3d
|
129
|
+
parse_properties(plot_area_node_child)
|
132
130
|
when 'line3DChart'
|
133
|
-
|
134
|
-
|
131
|
+
@type = :line_3d
|
132
|
+
parse_properties(plot_area_node_child)
|
135
133
|
when 'bar3DChart'
|
136
|
-
|
137
|
-
|
134
|
+
@type = :bar_3d
|
135
|
+
parse_properties(plot_area_node_child)
|
138
136
|
when 'pie3DChart'
|
139
|
-
|
140
|
-
|
137
|
+
@type = :pie_3d
|
138
|
+
parse_properties(plot_area_node_child)
|
141
139
|
end
|
142
140
|
end
|
143
|
-
chart_node_child
|
144
|
-
|
145
|
-
when 'catAx', 'valAx'
|
146
|
-
chart.axises << ChartAxis.new(parent: chart).parse(plot_area_node_child)
|
147
|
-
end
|
148
|
-
end
|
149
|
-
chart.plot_area = PlotArea.new(parent: chart).parse(chart_node_child)
|
141
|
+
parse_axis(chart_node_child)
|
142
|
+
@plot_area = PlotArea.new(parent: self).parse(chart_node_child)
|
150
143
|
when 'title'
|
151
|
-
|
144
|
+
@title = ChartAxisTitle.new(parent: self).parse(chart_node_child)
|
152
145
|
when 'legend'
|
153
|
-
|
146
|
+
@legend = ChartLegend.new(parent: self).parse(chart_node_child)
|
154
147
|
when 'view3D'
|
155
|
-
|
148
|
+
@view_3d = View3D.new(parent: self).parse(chart_node_child)
|
156
149
|
when 'pivotFmts'
|
157
|
-
|
150
|
+
@pivot_formats = PivotFormats.new(parent: self).parse(chart_node_child)
|
158
151
|
end
|
159
152
|
end
|
160
153
|
end
|
161
154
|
end
|
162
155
|
end
|
163
156
|
end
|
164
|
-
|
157
|
+
self
|
158
|
+
end
|
159
|
+
|
160
|
+
private
|
161
|
+
|
162
|
+
# Perform parsing of axis info
|
163
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
164
|
+
# @return [void]
|
165
|
+
def parse_axis(node)
|
166
|
+
node.xpath('*').each do |node_child|
|
167
|
+
case node_child.name
|
168
|
+
when 'catAx', 'valAx'
|
169
|
+
@axises << ChartAxis.new(parent: self).parse(node_child)
|
170
|
+
end
|
171
|
+
end
|
165
172
|
end
|
166
173
|
end
|
167
174
|
end
|
@@ -11,16 +11,12 @@ module OoxmlParser
|
|
11
11
|
# @return [ValuedChild] the position of the tick labels
|
12
12
|
attr_reader :tick_label_position
|
13
13
|
|
14
|
-
def initialize(
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
@display = display
|
21
|
-
@minor_grid_lines = minor_grid_lines
|
22
|
-
@major_grid_lines = major_grid_lines
|
23
|
-
@parent = parent
|
14
|
+
def initialize(params = {})
|
15
|
+
@title = params.fetch(:title, ChartAxisTitle.new)
|
16
|
+
@display = params.fetch(:display, true)
|
17
|
+
@minor_grid_lines = params.fetch(:minor_grid_lines, false)
|
18
|
+
@major_grid_lines = params.fetch(:major_grid_lines, false)
|
19
|
+
super(parent: params[:parent])
|
24
20
|
end
|
25
21
|
|
26
22
|
# Parse ChartAxis object
|
@@ -5,12 +5,10 @@ module OoxmlParser
|
|
5
5
|
class ChartLegend < OOXMLDocumentObject
|
6
6
|
attr_accessor :position, :overlay
|
7
7
|
|
8
|
-
def initialize(
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
@overlay = overlay
|
13
|
-
@parent = parent
|
8
|
+
def initialize(params = {})
|
9
|
+
@position = params.fetch(:position, :right)
|
10
|
+
@overlay = params.fetch(:overlay, false)
|
11
|
+
super(parent: params[:parent])
|
14
12
|
end
|
15
13
|
|
16
14
|
# Return combined data from @position and @overlay
|
data/lib/ooxml_parser/common_parser/common_data/alternate_content/chart/display_labels_properties.rb
CHANGED
@@ -11,10 +11,10 @@ module OoxmlParser
|
|
11
11
|
# @return [True, False] is label is deleted
|
12
12
|
attr_reader :delete
|
13
13
|
|
14
|
-
def initialize(
|
15
|
-
@show_legend_key = show_legend_key
|
16
|
-
@show_values = show_values
|
17
|
-
|
14
|
+
def initialize(params = {})
|
15
|
+
@show_legend_key = params.fetch(:show_legend_key, false)
|
16
|
+
@show_values = params.fetch(:show_values, false)
|
17
|
+
super(parent: params[:parent])
|
18
18
|
end
|
19
19
|
|
20
20
|
# Parse DisplayLabelsProperties object
|
@@ -16,7 +16,7 @@ module OoxmlParser
|
|
16
16
|
|
17
17
|
def initialize(properties = DocxDrawingProperties.new, parent: nil)
|
18
18
|
@properties = properties
|
19
|
-
|
19
|
+
super(parent: parent)
|
20
20
|
end
|
21
21
|
|
22
22
|
# Parse DocxDrawing
|
@@ -30,34 +30,15 @@ module OoxmlParser
|
|
30
30
|
when 'inline'
|
31
31
|
@type = :inline
|
32
32
|
end
|
33
|
-
@properties.distance_from_text = DocxDrawingDistanceFromText.new(parent: self).parse(node_child)
|
34
|
-
@properties.wrap = DocxWrapDrawing.new(parent: self).parse(node_child)
|
35
|
-
node_child.attributes.each do |key, value|
|
36
|
-
case key
|
37
|
-
when 'relativeHeight'
|
38
|
-
@properties.relative_height = value.value.to_i
|
39
|
-
end
|
40
|
-
end
|
41
33
|
node_child.xpath('*').each do |content_node_child|
|
42
34
|
case content_node_child.name
|
43
|
-
when 'simplePos'
|
44
|
-
@properties.simple_position = OOXMLCoordinates.parse(content_node_child)
|
45
|
-
when 'extent'
|
46
|
-
@properties.object_size = OOXMLCoordinates.parse(content_node_child, x_attr: 'cx', y_attr: 'cy', unit: :emu)
|
47
35
|
when 'graphic'
|
48
36
|
@graphic = DocxGraphic.new(parent: self).parse(content_node_child)
|
49
|
-
when 'positionV'
|
50
|
-
@properties.vertical_position = DocxDrawingPosition.new(parent: self).parse(content_node_child)
|
51
|
-
when 'positionH'
|
52
|
-
@properties.horizontal_position = DocxDrawingPosition.new(parent: self).parse(content_node_child)
|
53
|
-
when 'sizeRelH'
|
54
|
-
@properties.size_relative_horizontal = SizeRelativeHorizontal.new(parent: self).parse(content_node_child)
|
55
|
-
when 'sizeRelV'
|
56
|
-
@properties.size_relative_vertical = SizeRelativeVertical.new(parent: self).parse(content_node_child)
|
57
37
|
when 'docPr'
|
58
38
|
@doc_properties = DocProperties.new(parent: self).parse(content_node_child)
|
59
39
|
end
|
60
40
|
end
|
41
|
+
@properties.parse(node_child)
|
61
42
|
end
|
62
43
|
self
|
63
44
|
end
|
@@ -8,9 +8,56 @@ require_relative 'docx_wrap_drawing'
|
|
8
8
|
module OoxmlParser
|
9
9
|
# Docx Drawing Properties
|
10
10
|
class DocxDrawingProperties < OOXMLDocumentObject
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
# @return [DocxDrawingDistanceFromText] distance from text
|
12
|
+
attr_reader :distance_from_text
|
13
|
+
# @return [DocxWrapDrawing] wrap of drawing
|
14
|
+
attr_reader :wrap
|
15
|
+
# @return [Integer] relative height of object
|
16
|
+
attr_reader :relative_height
|
17
|
+
# @return [OOXMLCoordinates] simple position of object
|
18
|
+
attr_reader :simple_position
|
19
|
+
# @return [OOXMLCoordinates] size of object
|
20
|
+
attr_reader :object_size
|
21
|
+
# @return [DocxDrawingPosition] vertical position
|
22
|
+
attr_reader :vertical_position
|
23
|
+
# @return [DocxDrawingPosition] horizontal position
|
24
|
+
attr_reader :horizontal_position
|
25
|
+
# @return [SizeRelativeHorizontal] size of drawing relative to horizontal
|
26
|
+
attr_reader :size_relative_horizontal
|
27
|
+
# @return [SizeRelativeVertical] size of drawing relative to vertical
|
28
|
+
attr_reader :size_relative_vertical
|
29
|
+
|
30
|
+
# Parse DocxDrawingProperties
|
31
|
+
# @param [Nokogiri::XML:Node] node with DocxDrawingProperties
|
32
|
+
# @return [DocxDrawingProperties] result of parsing
|
33
|
+
def parse(node)
|
34
|
+
@distance_from_text = DocxDrawingDistanceFromText.new(parent: self).parse(node)
|
35
|
+
@wrap = DocxWrapDrawing.new(parent: self).parse(node)
|
36
|
+
|
37
|
+
node.attributes.each do |key, value|
|
38
|
+
case key
|
39
|
+
when 'relativeHeight'
|
40
|
+
@relative_height = value.value.to_i
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
node.xpath('*').each do |content_node_child|
|
45
|
+
case content_node_child.name
|
46
|
+
when 'simplePos'
|
47
|
+
@simple_position = OOXMLCoordinates.parse(content_node_child)
|
48
|
+
when 'extent'
|
49
|
+
@object_size = OOXMLCoordinates.parse(content_node_child, x_attr: 'cx', y_attr: 'cy', unit: :emu)
|
50
|
+
when 'positionV'
|
51
|
+
@vertical_position = DocxDrawingPosition.new(parent: self).parse(content_node_child)
|
52
|
+
when 'positionH'
|
53
|
+
@horizontal_position = DocxDrawingPosition.new(parent: self).parse(content_node_child)
|
54
|
+
when 'sizeRelH'
|
55
|
+
@size_relative_horizontal = SizeRelativeHorizontal.new(parent: self).parse(content_node_child)
|
56
|
+
when 'sizeRelV'
|
57
|
+
@size_relative_vertical = SizeRelativeVertical.new(parent: self).parse(content_node_child)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
self
|
61
|
+
end
|
15
62
|
end
|
16
63
|
end
|
data/lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/docx_graphic.rb
CHANGED
@@ -24,7 +24,7 @@ module OoxmlParser
|
|
24
24
|
when 'chart'
|
25
25
|
@type = :chart
|
26
26
|
OOXMLDocumentObject.add_to_xmls_stack("#{OOXMLDocumentObject.root_subfolder}/#{OOXMLDocumentObject.get_link_from_rels(node_child.attribute('id').value)}")
|
27
|
-
@data = Chart.
|
27
|
+
@data = Chart.new(parent: self).parse
|
28
28
|
OOXMLDocumentObject.xmls_stack.pop
|
29
29
|
when 'wgp'
|
30
30
|
@type = :group
|
@@ -16,10 +16,6 @@ module OoxmlParser
|
|
16
16
|
# @return [LineReference] line reference
|
17
17
|
attr_reader :line_reference
|
18
18
|
|
19
|
-
def initialize(parent: nil)
|
20
|
-
@parent = parent
|
21
|
-
end
|
22
|
-
|
23
19
|
# Parse ShapeStyle object
|
24
20
|
# @param node [Nokogiri::XML:Element] node to parse
|
25
21
|
# @return [ShapeStyle] result of parsing
|
@@ -8,10 +8,6 @@ module OoxmlParser
|
|
8
8
|
# @return [Color] scheme color of EffectReference
|
9
9
|
attr_reader :scheme_color
|
10
10
|
|
11
|
-
def initialize(parent: nil)
|
12
|
-
@parent = parent
|
13
|
-
end
|
14
|
-
|
15
11
|
# Parse EffectReference object
|
16
12
|
# @param node [Nokogiri::XML:Element] node to parse
|
17
13
|
# @return [EffectReference] result of parsing
|
@@ -8,10 +8,6 @@ module OoxmlParser
|
|
8
8
|
# @return [Color] scheme color of FillReference
|
9
9
|
attr_reader :scheme_color
|
10
10
|
|
11
|
-
def initialize(parent: nil)
|
12
|
-
@parent = parent
|
13
|
-
end
|
14
|
-
|
15
11
|
# Parse FillReference object
|
16
12
|
# @param node [Nokogiri::XML:Element] node to parse
|
17
13
|
# @return [FillReference] result of parsing
|