ooxml_parser 0.8.0 → 0.11.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 +1 -1
- 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 +1 -1
- 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/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 +6 -6
- data/lib/ooxml_parser/common_parser/common_data/color/color_helper.rb +29 -0
- 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 +8 -1
- data/lib/ooxml_parser/common_parser/common_data/coordinates.rb +2 -2
- data/lib/ooxml_parser/common_parser/common_data/hyperlink.rb +2 -2
- data/lib/ooxml_parser/common_parser/common_data/ooxml_document_object.rb +1 -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 +3 -3
- data/lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run/run_properties/outline.rb +1 -1
- 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 +1 -1
- 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 +2 -2
- 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 +4 -4
- 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 +2 -2
- 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 +1 -1
- 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 +1 -1
- 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 +1 -0
- data/lib/ooxml_parser/docx_parser/docx_data/document_structure/page_properties/note.rb +1 -0
- 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 +1 -1
- 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/version.rb +1 -1
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook.rb +17 -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/pivot_cache/pivot_cache_definition.rb +6 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field/shared_items.rb +42 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition.rb +114 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/column_row_items.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/column_row_items/column_row_item.rb +22 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/location.rb +34 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field.rb +37 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field/items.rb +43 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field/items/item.rb +26 -0
- data/lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_table_definition/pivot_table_style_info.rb +42 -0
- 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/fills/fill.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 +110 -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: 152de470eb7ecac05ca2d886b7c7113edb6a2c388fe29491b5b0c4341e771237
|
4
|
+
data.tar.gz: cf0aa14cc429393d88a2e3a39961242ab740c96a878d149ec74cdaade6fd2587
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34869710a5435a3d26c6b70dd42b1290cd80a1b7dff16582f3d4abaaa765877b69c58a9af5543b86cdbad78c27dd3849daf14f09e8bf0c8e5c4c5bfd3fdb0b8f
|
7
|
+
data.tar.gz: 538f12d23be8b548ef8bbcfd476f93f4c0926cfbe9c71d7101a97ccf040e8c238dece97f7c04d49bef6dd524e296795c3f1ada9b368016bf6864f9262cfd1dcc
|
@@ -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
|
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
|
@@ -8,10 +8,6 @@ module OoxmlParser
|
|
8
8
|
# @return [Color] scheme color of FontReference
|
9
9
|
attr_reader :scheme_color
|
10
10
|
|
11
|
-
def initialize(parent: nil)
|
12
|
-
@parent = parent
|
13
|
-
end
|
14
|
-
|
15
11
|
# Parse FontReference object
|
16
12
|
# @param node [Nokogiri::XML:Element] node to parse
|
17
13
|
# @return [FontReference] result of parsing
|
@@ -8,10 +8,6 @@ module OoxmlParser
|
|
8
8
|
# @return [Color] scheme color of LineReference
|
9
9
|
attr_reader :scheme_color
|
10
10
|
|
11
|
-
def initialize(parent: nil)
|
12
|
-
@parent = parent
|
13
|
-
end
|
14
|
-
|
15
11
|
# Parse LineReference object
|
16
12
|
# @param node [Nokogiri::XML:Element] node to parse
|
17
13
|
# @return [LineReference] result of parsing
|