source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/drawing.rb | Ruby | mit | 305 | main | 23,442 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/common'
require 'write_xlsx/utility/xml_primitives'
module Writexlsx
class Drawing
include Writexlsx::Utility::Common
include Writexlsx::Utility::XmlPrimitives
attr_accessor ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart.rb | Ruby | mit | 305 | main | 21,423 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# Chart
#
# The Chart class acts as a facade coordinating chart configuration,
# data management and XML generation.
#
# Responsibilities are delegated to specialized modules:
#
# I... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/gradient.rb | Ruby | mit | 305 | main | 2,031 | # frozen_string_literal: true
module Writexlsx
module Gradient
def gradient_properties(args)
return unless ptrue?(args)
gradient = {}
types = {
'linear' => 'linear',
'radial' => 'circle',
'rectangular' => 'rect',
'path' => 'shape'
}
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/format.rb | Ruby | mit | 305 | main | 29,767 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/utility/common'
require 'write_xlsx/utility/xml_primitives'
require 'write_xlsx/format/fill_style'
require 'write_xlsx/format/fill_state'
require 'write_xlsx/format/border_style'
require 'write_xlsx/format/border_state'
require 'write_xlsx/forma... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/zip_file_utils.rb | Ruby | mit | 305 | main | 2,404 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
#
# from http://d.hatena.ne.jp/alunko/20071021
#
require 'kconv'
require 'zip/filesystem'
require 'fileutils'
module ZipFileUtils
# src file or directory
# dest zip filename
# options :fs_encoding=[UTF-8,Shift_JIS,EUC-JP]
def self.zip(src, dest, options ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet.rb | Ruby | mit | 305 | main | 24,176 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# Workbook
#
# The Workbook class acts as a facade coordinating workbook state,
# package preparation and XML generation.
#
# Responsibilities are delegated to specialized modules:
#
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/colors.rb | Ruby | mit | 305 | main | 1,640 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Colors
COLORS = {
aqua: 0x0F,
cyan: 0x0F,
black: 0x08,
blue: 0x0C,
brown: 0x10,
magenta: 0x0E,
fuchsia: 0x0E,
gray: 0x17,
grey: 0x17,
green... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/compatibility.rb | Ruby | mit | 305 | main | 1,175 | # coding: utf-8
# frozen_string_literal: true
#
# Why would we ever use Ruby 1.8.7 when we can backport with something
# as simple as this?
#
# copied from prawn.
# modified by Hideo NAKAMURA
#
class String # :nodoc:
def first_line
each_line { |line| return line }
end
alias lines to_a unless "".respond_to?(:... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/shape.rb | Ruby | mit | 305 | main | 9,576 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/utility/chart_formatting'
module Writexlsx
###############################################################################
#
# Shape - A class for writing Excel shapes.
#
# Used in conjunction with WriteXLSX.
#
# Copyright 2000-20... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/workbook.rb | Ruby | mit | 305 | main | 18,753 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# Workbook
#
# The Workbook class acts as a facade coordinating workbook state,
# package preparation and XML generation.
#
# Responsibilities are delegated to specialized modules:
#
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/inserted_chart.rb | Ruby | mit | 305 | main | 1,007 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class InsertedChart
include Writexlsx::Utility::Common
attr_reader :row, :col, :chart, :x_offset, :y_offset
attr_reader :x_scale, :y_scale
attr_reader :anchor, :description, :decorative
def initialize(
row, col, ch... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/image.rb | Ruby | mit | 305 | main | 1,529 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/image_property'
module Writexlsx
class Image
attr_reader :row, :col, :x_offset, :y_offset, :x_scale, :y_scale
attr_reader :url, :tip, :anchor, :description, :decorative
def initialize(
row, col, image, x_offset, y_offse... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/workbook/workbook_writer.rb | Ruby | mit | 305 | main | 4,570 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Workbook
module Initialization
#
# user must not use. it is internal method.
#
def assemble_xml_file # :nodoc:
return unless @writer
# Prepare format object for passing to Style.rb.
prep... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/workbook/chart_data.rb | Ruby | mit | 305 | main | 6,248 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Workbook
module ChartData
private
#
# Convert a range formula such as Sheet1!$B$1:$B$5 into a sheet name and cell
# range such as ( 'Sheet1', 0, 1, 4, 1 ).
#
def get_chart_range(range) # :nodoc:
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/workbook/format_preparation.rb | Ruby | mit | 305 | main | 6,659 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Workbook
module FormatPreparation
private
#
# Prepare all of the format properties prior to passing them to Styles.rb.
#
def prepare_format_properties # :nodoc:
# Separate format objects into XF an... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/workbook/package_preparation.rb | Ruby | mit | 305 | main | 6,965 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Workbook
module PackagePreparation
private
#
# Assemble worksheets into a workbook.
#
def store_workbook # :nodoc:
# Add a default worksheet if non have been added.
add_worksheet if @worksh... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/workbook/initialization.rb | Ruby | mit | 305 | main | 7,202 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Workbook
#
# Workbook initialization helpers extracted from Workbook to keep the main
# class focused on public API and orchestration.
#
module Initialization
private
def setup_core_state(file, options, defa... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/scatter.rb | Ruby | mit | 305 | main | 7,032 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# Scatter - A class for writing Excel Scatter charts.
#
# Used in conjunction with Chart.
#
# See formatting note in Chart.
#
# Copyright 2000-2011, John McNamara, jmcnamara@cpan.org
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/d_pt_point_writer.rb | Ruby | mit | 305 | main | 297 | module Writexlsx
class Chart
module DPtPointWriter
def write_d_pt_point(index, point)
@writer.tag_elements('c:dPt') do
write_idx(index)
@writer.tag_elements('c:marker') do
write_sp_pr(point)
end
end
end
end
end
end |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/chart_area.rb | Ruby | mit | 305 | main | 3,514 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Chart
class ChartArea
include Writexlsx::Utility::Common
include Writexlsx::Utility::ChartFormatting
include Writexlsx::Gradient
attr_reader :line, :fill, :pattern, :gradient, :layout
def initialize(param... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/formatting_writer.rb | Ruby | mit | 305 | main | 18,060 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# formatting_writer.rb - formatting, rich text, and label XML helpers
#
###############################################################################
module Writexlsx
class Chart... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/series_writer.rb | Ruby | mit | 305 | main | 8,403 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# series_writer.rb - series and cache XML output helpers
#
###############################################################################
module Writexlsx
class Chart
module S... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/series_data.rb | Ruby | mit | 305 | main | 3,846 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# series_data.rb - series/formula bookkeeping and axis id management
#
###############################################################################
module Writexlsx
class Chart
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/series.rb | Ruby | mit | 305 | main | 13,963 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Chart
require 'write_xlsx/utility/common'
require 'write_xlsx/utility/cell_reference'
require 'write_xlsx/utility/chart_formatting'
require 'write_xlsx/utility/rich_text'
require 'write_xlsx/utility/sheetname_quoting'
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/legend.rb | Ruby | mit | 305 | main | 297 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Chart
class Legend
attr_accessor :line, :fill, :pattern, :gradient
attr_accessor :position, :delete_series, :layout, :font
def initialize
@position = 'right'
end
end
end
end |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/axis_writer.rb | Ruby | mit | 305 | main | 14,881 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# axis_writer.rb - axis-specific XML output helpers
#
###############################################################################
module Writexlsx
class Chart
module AxisWr... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/pie.rb | Ruby | mit | 305 | main | 6,634 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# Pie - A class for writing Excel Pie charts.
#
# Used in conjunction with Chart.
#
# See formatting note in Chart.
#
# Copyright 2000-2011, John McNamara, jmcnamara@cpan.org
# Conver... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/initialization.rb | Ruby | mit | 305 | main | 2,371 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/chart/axis'
require 'write_xlsx/chart/legend'
module Writexlsx
class Chart
module Initialization
private
def axis_setup
@axis_ids = []
@axis2_ids = []
@cat_has_num_fmt = false
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/radar.rb | Ruby | mit | 305 | main | 2,560 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# Radar - A class for writing Excel Radar charts.
#
# Used in conjunction with Chart.
#
# See formatting note in Chart.
#
# Copyright 2000-2012, John McNamara, jmcnamara@cpan.org
# Co... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/area.rb | Ruby | mit | 305 | main | 2,075 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# Area - A class for writing Excel Area charts.
#
# Used in conjunction with Chart.
#
# See formatting note in Chart.
#
# Copyright 2000-2011, John McNamara, jmcnamara@cpan.org
# Conv... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/doughnut.rb | Ruby | mit | 305 | main | 2,119 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# Doughnut - A class for writing Excel Doughnut charts.
#
# Used in conjunction with Excel::Writer::XLSX::Chart.
#
# See formatting note in Excel::Writer::XLSX::Chart.
#
# Copyright 2... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/bar.rb | Ruby | mit | 305 | main | 2,835 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# Bar - A class for writing Excel Bar charts.
#
# Used in conjunction with Chart.
#
# See formatting note in Chart.
#
# Copyright 2000-2011, John McNamara, jmcnamara@cpan.org
# Conver... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/axis.rb | Ruby | mit | 305 | main | 6,577 | # -*- encoding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/chart/caption'
module Writexlsx
class Chart
class Axis
include Writexlsx::Utility::Common
include Writexlsx::Utility::RichText
attr_accessor :defaults
attr_accessor... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/line.rb | Ruby | mit | 305 | main | 2,494 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# Line - A class for writing Excel Line charts.
#
# Used in conjunction with Chart.
#
# See formatting note in Chart.
#
# Copyright 2000-2011, John McNamara, jmcnamara@cpan.org
# Conv... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/table.rb | Ruby | mit | 305 | main | 1,598 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/utility/common'
require 'write_xlsx/utility/chart_formatting'
require 'write_xlsx/utility/rich_text'
module Writexlsx
class Chart
class Table
include Writexlsx::Utility::Common
include Writexlsx::Utility::ChartFormatting
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/caption.rb | Ruby | mit | 305 | main | 1,248 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Chart
class Caption
include Writexlsx::Utility::Common
include Writexlsx::Utility::RichText
attr_accessor :name, :formula, :data_id, :font
attr_accessor :line, :fill, :pattern, :gradient
attr_reader :layou... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/column.rb | Ruby | mit | 305 | main | 2,023 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# Column - A class for writing Excel Column charts.
#
# Used in conjunction with Chart.
#
# See formatting note in Chart.
#
# Copyright 2000-2011, John McNamara, jmcnamara@cpan.org
# ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/stock.rb | Ruby | mit | 305 | main | 3,505 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# Stock - A class for writing Excel Stock charts.
#
# Used in conjunction with Chart.
#
# See formatting note in Chart.
#
# Copyright 2000-2011, John McNamara, jmcnamara@cpan.org
# Co... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/xml_writer.rb | Ruby | mit | 305 | main | 8,330 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# xml_writer.rb - core chart XML assembly flow
#
###############################################################################
module Writexlsx
class Chart
module XmlWriter
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/chart/settings.rb | Ruby | mit | 305 | main | 6,273 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# settings.rb - common chart facade and orchestration
#
###############################################################################
module Writexlsx
class Chart
module Sett... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/selection.rb | Ruby | mit | 305 | main | 1,220 | # frozen_string_literal: true
module Writexlsx
class Worksheet
# Selection-related operations extracted from Worksheet to slim the main class.
module Selection
#
# :call-seq:
# set_selection(cell_or_cell_range)
#
# Set which cell or cells are selected in a worksheet.
#
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/cell_data.rb | Ruby | mit | 305 | main | 6,115 | # -*- encoding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/utility/common'
require 'write_xlsx/utility/cell_reference'
module Writexlsx
class Worksheet
class CellData # :nodoc:
include Writexlsx::Utility::Common
include Writexlsx::Utility::CellReference
attr_reader :xf
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/autofilter.rb | Ruby | mit | 305 | main | 12,000 | # frozen_string_literal: true
require 'write_xlsx/constants'
module Writexlsx
class Worksheet
# Autofilter-related operations extracted from Worksheet to slim the main class.
module Autofilter
include Constants
#
# :call-seq:
# autofilter(first_row, first_col, last_row, last_col)
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/data_writing.rb | Ruby | mit | 305 | main | 40,248 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
###############################################################################
#
# DataWriting - A module for writing data to worksheet cells.
#
# Used in conjunction with WriteXLSX
#
# Copyright 2000-2011, John McNamara, jmcnamara@cpan.org
# Convert to ruby by Hi... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/rich_text_helpers.rb | Ruby | mit | 305 | main | 2,592 | # frozen_string_literal: true
module Writexlsx
class Worksheet
module RichTextHelpers
def cell_format_of_rich_string(rich_strings)
# If the last arg is a format we use it as the cell format.
rich_strings.pop if rich_strings[-1].respond_to?(:xf_index)
end
#
# Convert the l... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/drawing_methods.rb | Ruby | mit | 305 | main | 10,892 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Worksheet
module DrawingMethods
###############################################################################
#
# DrawingMethods
#
# Provides high-level Worksheet APIs for inserting drawing-related object... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/drawing_xml_writer.rb | Ruby | mit | 305 | main | 1,150 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Worksheet
module DrawingXmlWriter
#
# Write the <drawing> elements.
#
def write_drawings # :nodoc:
increment_rel_id_and_write_r_id('drawing') if drawings?
end
#
# Write the <legacyDrawi... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/drawing_preparation.rb | Ruby | mit | 305 | main | 9,675 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Worksheet
module DrawingPreparation
###############################################################################
#
# DrawingPreparation
#
# Prepares drawing-related assets for XLSX output.
#
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/protection.rb | Ruby | mit | 305 | main | 1,987 | # frozen_string_literal: true
module Writexlsx
class Worksheet
# Protection-related operations extracted from Worksheet to slim the main class.
module Protection
#
# Set the worksheet protection flags to prevent modification of worksheet
# objects.
#
def protect(password = nil, ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/drawing_relations.rb | Ruby | mit | 305 | main | 2,309 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Worksheet
module DrawingRelations
###############################################################################
#
# DrawingRelations
#
# Manages drawing relationships and external linkage information.
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/cell_data_manager.rb | Ruby | mit | 305 | main | 1,300 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Worksheet
module CellDataManager
#
# Store a CellData object in the worksheet cell table.
#
def store_data_to_table(cell_data, row, col) # :nodoc:
@cell_data_store.store(cell_data, row, col)
end
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/formatting.rb | Ruby | mit | 305 | main | 11,999 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/constants'
###############################################################################
#
# Formatting - A module for worksheet layout and print/appearance settings.
#
# Used in conjunction with WriteXLSX
#
# Copyright 2000-2011, John McNama... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/row_col_sizing.rb | Ruby | mit | 305 | main | 1,825 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/utility/string_width'
module Writexlsx
class Worksheet
module RowColSizing
include Writexlsx::Utility::StringWidth
#
# Convert the width of a cell from user's units to pixels. Excel rounds
# the column width to th... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/print_options.rb | Ruby | mit | 305 | main | 1,709 | # frozen_string_literal: true
module Writexlsx
class Worksheet
# Print and display options extracted from Worksheet to slim the main class.
module PrintOptions
#
# Set the page orientation as portrait.
# The default worksheet orientation is portrait, so you won't generally
# need to c... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/panes.rb | Ruby | mit | 305 | main | 1,845 | # frozen_string_literal: true
module Writexlsx
class Worksheet
# Pane-related operations extracted from Worksheet to slim the main class.
module Panes
###############################################################################
#
# set_top_left_cell()
#
# Set the first visibl... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/rows.rb | Ruby | mit | 305 | main | 2,353 | # frozen_string_literal: true
module Writexlsx
class Worksheet
# Row-related operations extracted from Worksheet to slim the main class.
module Rows
#
# :call-seq:
# set_row(row [ , height, format, hidden, level, collapsed ])
#
# This method can be used to change the default p... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/asset_manager.rb | Ruby | mit | 305 | main | 1,127 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Worksheet
class AssetManager
attr_reader :charts, :images, :tables, :sparklines, :shapes
attr_accessor :background_image
attr_reader :header_images, :footer_images
def initialize
@charts = []
@im... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/conditional_formats.rb | Ruby | mit | 305 | main | 969 | # frozen_string_literal: true
module Writexlsx
class Worksheet
# Conditional formatting operations extracted from Worksheet to slim the main class.
module ConditionalFormats
#
# :call-seq:
# conditional_formatting(cell_or_cell_range, options)
#
# Conditional formatting is a fe... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/columns.rb | Ruby | mit | 305 | main | 7,671 | # frozen_string_literal: true
module Writexlsx
class Worksheet
# Column-related operations extracted from Worksheet to slim the main class.
module Columns
# :call-seq:
# set_column(firstcol, lastcol, width, format, hidden, level, collapsed)
#
# This method can be used to change the ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/comments_support.rb | Ruby | mit | 305 | main | 1,329 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Worksheet
module CommentsSupport
#
# This method is used to make all cell comments visible when a worksheet
# is opened.
#
def show_comments(visible = true)
@comments_visible = visible
end
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/cell_data_store.rb | Ruby | mit | 305 | main | 1,167 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Worksheet
class CellDataStore # :nodoc:
def initialize
@table = []
end
def [](row)
@table[row]
end
def row(row)
@table[row]
end
def row?(row)
!@table[row].nil?... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/data_validation.rb | Ruby | mit | 305 | main | 10,522 | # -*- encoding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/utility/common'
require 'write_xlsx/utility/cell_reference'
require 'write_xlsx/utility/dimensions'
require 'write_xlsx/utility/date_time'
module Writexlsx
class Worksheet
class DataValidation # :nodoc:
include Writexlsx::Utilit... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/hyperlink.rb | Ruby | mit | 305 | main | 4,510 | # -*- encoding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/utility/common'
require 'write_xlsx/utility/cell_reference'
require 'write_xlsx/utility/url'
require 'write_xlsx/utility/xml_primitives'
module Writexlsx
class Worksheet
class Hyperlink # :nodoc:
include Writexlsx::Utility::Comm... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/initialization.rb | Ruby | mit | 305 | main | 3,415 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Worksheet
module Initialization
def setup_identity(workbook, index, name)
@workbook = workbook
@index = index
@name = name
@excel_version = 2007
@palette = workbook.palette
@default... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/worksheet/xml_writer.rb | Ruby | mit | 305 | main | 39,214 | # frozen_string_literal: true
require 'write_xlsx/utility/string_width'
module Writexlsx
class Worksheet
module XmlWriter
include Writexlsx::Utility::StringWidth
def assemble_xml_file # :nodoc:
write_xml_declaration do
@writer.tag_elements('worksheet', write_worksheet_attributes) ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/utility/sheetname_quoting.rb | Ruby | mit | 305 | main | 1,896 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
module Utility
module SheetnameQuoting
#
# Sheetnames used in references should be quoted if they contain any spaces,
# special characters or if the look like something that isn't a sheet name.
# TODO. We need to handl... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/utility/drawing.rb | Ruby | mit | 305 | main | 3,245 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
module Utility
module Drawing
#
# Convert vertices from pixels to points.
#
def pixels_to_points(vertices)
_col_start, _row_start, _x1, _y1,
_col_end, _row_end, _x2, _y2,
left, to... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/utility/common.rb | Ruby | mit | 305 | main | 1,020 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
module Utility
module Common
PERL_TRUE_VALUES = [false, nil, 0, "0", "", [], {}].freeze
#
# return perl's boolean result
#
def ptrue?(value)
!PERL_TRUE_VALUES.include?(value)
end
def check... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/utility/cell_reference.rb | Ruby | mit | 305 | main | 4,111 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/col_name'
require 'write_xlsx/constants'
module Writexlsx
module Utility
module CellReference
include Constants
#
# xl_rowcol_to_cell($row, col, row_absolute, col_absolute)
#
def xl_rowcol_to_cell(row_or_nam... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/utility/xml_primitives.rb | Ruby | mit | 305 | main | 587 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
module Utility
module XmlPrimitives
#
# Write the <color> element.
#
def write_color(name, value, writer = @writer) # :nodoc:
attributes = [[name, value]]
writer.empty_tag('color', attributes)
en... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/utility/dimensions.rb | Ruby | mit | 305 | main | 1,107 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/constants'
module Writexlsx
module Utility
module Dimensions
include Constants
def check_dimensions(row, col)
raise WriteXLSXDimensionError if !row || row >= ROW_MAX || !col || col >= COL_MAX
0
end
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/utility/url.rb | Ruby | mit | 305 | main | 608 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
module Utility
module Url
def escape_url(url)
unless url =~ /%[0-9a-fA-F]{2}/
# Escape the URL escape symbol.
url = url.gsub("%", "%25")
# Escape whitespae in URL.
url = url.gsub(/[\s\x00... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/utility/string_width.rb | Ruby | mit | 305 | main | 1,957 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
module Utility
module StringWidth
MAX_DIGIT_WIDTH = 7 # For Calabri 11. # :nodoc:
PADDING = 5 # :nodoc:
DEFAULT_COL_PIXELS = 64
CHAR_WIDTHS = {
' ' => 3, '!' => 5, '"'... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/utility/rich_text.rb | Ruby | mit | 305 | main | 5,346 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
module Utility
module RichText
def underline_attributes(underline)
case underline
when 2
[%w[val double]]
when 33
[%w[val singleAccounting]]
when 34
[%w[val doubleAccounting]... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/utility/date_time.rb | Ruby | mit | 305 | main | 4,313 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
module Utility
module DateTime
#
# convert_date_time(date_time_string)
#
# The function takes a date and time in ISO8601 "yyyy-mm-ddThh:mm:ss.ss" format
# and converts it to a decimal number representing a valid ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/utility/chart_formatting.rb | Ruby | mit | 305 | main | 8,248 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
module Utility
module ChartFormatting
PATTERN_TYPES = {
'percent_5' => 'pct5',
'percent_10' => 'pct10',
'percent_20' => 'pct20',
'percent_25' => 'p... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/format/alignment_state.rb | Ruby | mit | 305 | main | 1,077 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Format
class AlignmentState
attr_accessor :horizontal, :vertical,
:wrap, :justlast, :rotation,
:indent, :shrink, :merge_range,
:reading_order, :just_distrib
def in... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/format/font_style.rb | Ruby | mit | 305 | main | 3,063 | # -*- encoding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Format
class FontStyle
def initialize(format)
@format = format
end
def index
@format.state.font.index
end
def index=(value)
@format.state.font.index = value
end
def ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/format/fill_state.rb | Ruby | mit | 305 | main | 552 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Format
class FillState
attr_accessor :fg_color, :bg_color, :pattern, :index, :count
def initialize
@fg_color = 0x00
@bg_color = 0x00
@pattern = 0
@index = 0
@count = 0
en... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/format/protection_style.rb | Ruby | mit | 305 | main | 499 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Format
class ProtectionStyle
def initialize(format)
@format = format
end
def locked
@format.state.protection.locked
end
def locked=(value)
@format.state.protection.locked = value
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/format/number_format_state.rb | Ruby | mit | 305 | main | 384 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Format
class NumberFormatState
attr_accessor :format_code, :index
def initialize
@format_code = 'General'
@index = 0
end
def initialize_copy(other)
@format_code = other.format_code... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/format/border_state.rb | Ruby | mit | 305 | main | 1,312 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Format
class BorderState
attr_accessor :index, :count,
:bottom, :bottom_color,
:diag_border, :diag_color, :diag_type,
:left, :left_color,
:right, :rig... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/format/alignment_style.rb | Ruby | mit | 305 | main | 1,798 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Format
class AlignmentStyle
def initialize(format)
@format = format
end
def horizontal
@format.state.alignment.horizontal
end
def horizontal=(value)
@format.state.alignment.horizon... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/format/font_state.rb | Ruby | mit | 305 | main | 1,826 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Format
class FontState
attr_accessor(
:index,
:name,
:size,
:bold,
:italic,
:color,
:underline,
:strikeout,
:outline,
:shadow,
:script,
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/format/format_state.rb | Ruby | mit | 305 | main | 1,969 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Format
class FormatState
attr_accessor :fill, :border, :font, :alignment, :protection, :number_format
attr_accessor :xf_index, :dxf_index, :xf_id
attr_accessor :quote_prefix
attr_accessor :has_fill, :has_font, :h... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/format/fill_style.rb | Ruby | mit | 305 | main | 901 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Format
class FillStyle
def initialize(format)
@format = format
end
def fg_color
@format.state.fill.fg_color
end
def bg_color
@format.state.fill.bg_color
end
def patter... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/format/protection_state.rb | Ruby | mit | 305 | main | 346 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Format
class ProtectionState
attr_accessor :locked, :hidden
def initialize
@locked = 1
@hidden = 0
end
def initialize_copy(other)
@locked = other.locked
@hidden = other.hidden
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/format/number_format_style.rb | Ruby | mit | 305 | main | 529 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Format
class NumberFormatStyle
def initialize(format)
@format = format
end
def format_code
@format.state.number_format.format_code
end
def format_code=(value)
@format.state.number_... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/format/border_style.rb | Ruby | mit | 305 | main | 2,151 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
class Format
class BorderStyle
def initialize(format)
@format = format
end
def index
@format.state.border.index
end
def index=(value)
@format.state.border.index = value
end
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/packager.rb | Ruby | mit | 305 | main | 14,204 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/package/app'
require 'write_xlsx/package/comments'
require 'write_xlsx/package/content_types'
require 'write_xlsx/package/core'
require 'write_xlsx/package/custom'
require 'write_xlsx/package/metada... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/conditional_format.rb | Ruby | mit | 305 | main | 29,592 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
module Writexlsx
module Package
class ConditionalFormat
include Writexlsx::Utility::Common
include Writexlsx::Utility::CellReference
include Writexlsx::Utility::Dimensions
include Writexlsx::Utility::DateTime
include Writexlsx::U... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/custom.rb | Ruby | mit | 305 | main | 2,941 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/xml_primitives'
module Writexlsx
module Package
class Custom
include Writexlsx::Utility::Common
include Writexlsx::Utility::XmlPrimitives
def initialize
@wr... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/app.rb | Ruby | mit | 305 | main | 5,964 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/xml_primitives'
module Writexlsx
module Package
class App
include Writexlsx::Utility::XmlPrimitives
attr_writer :doc_security
def initialize(workbook)
@wri... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/content_types.rb | Ruby | mit | 305 | main | 7,851 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/xml_primitives'
module Writexlsx
module Package
class ContentTypes
include Writexlsx::Utility::XmlPrimitives
App_package = 'application/vnd.openxmlformats-package.'
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/theme.rb | Ruby | mit | 305 | main | 7,731 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
module Writexlsx
module Package
class Theme
def initialize
@writer = nil
end
def assemble_xml_file
return unless @writer
write_theme_file
@writer.write("\n")
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/relationships.rb | Ruby | mit | 305 | main | 3,152 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/xml_primitives'
module Writexlsx
module Package
class Relationships
include Writexlsx::Utility::XmlPrimitives
Schema_root = 'http://schemas.openxmlformats.org'
... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/core.rb | Ruby | mit | 305 | main | 4,121 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/xml_primitives'
module Writexlsx
module Package
class Core
include Writexlsx::Utility::XmlPrimitives
App_package = 'application/vnd.openxmlformats-package.'
App_do... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/comments.rb | Ruby | mit | 305 | main | 12,373 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/constants'
require 'write_xlsx/format'
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/common'
require 'write_xlsx/utility/cell_reference'
require 'write_xlsx/utility/drawing'
module Writexlsx
module Package
cla... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/vml.rb | Ruby | mit | 305 | main | 8,918 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/drawing'
module Writexlsx
module Package
class Vml
include Writexlsx::Utility::Drawing
def initialize
@writer = Package::XMLWriterSimple.new
end
def ... |
github | cxn03651/write_xlsx | https://github.com/cxn03651/write_xlsx | lib/write_xlsx/package/table.rb | Ruby | mit | 305 | main | 15,330 | # -*- coding: utf-8 -*-
# frozen_string_literal: true
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility/common'
require 'write_xlsx/utility/cell_reference'
require 'write_xlsx/utility/dimensions'
require 'write_xlsx/utility/xml_primitives'
module Writexlsx
module Package
class Table
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.