Skip to content

Commit

Permalink
[docs] switch to PlotlyJS
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Dec 7, 2023
1 parent cecc5ba commit e868731
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 13 deletions.
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
MultiObjectiveAlgorithms = "0327d340-17cd-11ea-3e99-2fd5d98cecda"
PATHSolver = "f5f7c340-0bb3-5c69-969a-41884d311d1b"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SCS = "c946c3f1-0d1f-5ce8-9dea-7daa1f7e2d13"
Expand Down Expand Up @@ -53,6 +54,7 @@ Literate = "2.8"
MathOptInterface = "=1.23.0"
MultiObjectiveAlgorithms = "=1.3.1"
PATHSolver = "=1.7.0"
PlotlyJS = "0.18"
Plots = "1"
SCS = "=2.0.0"
SQLite = "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import HiGHS
import Plots
import SparseArrays
import Test #src
Plots.plotlyjs()

# ## Background

Expand Down
1 change: 1 addition & 0 deletions docs/src/tutorials/algorithms/tsp_lazy_constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ using JuMP
import GLPK
import Random
import Plots
Plots.plotlyjs()

# ## [Mathematical Formulation](@id tsp_model)

Expand Down
1 change: 1 addition & 0 deletions docs/src/tutorials/applications/power_systems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import DataFrames
import HiGHS
import Plots
import StatsPlots
Plots.plotlyjs()

# ## Economic dispatch

Expand Down
1 change: 1 addition & 0 deletions docs/src/tutorials/applications/two_stage_stochastic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import HiGHS
import Plots
import StatsPlots
import Statistics
Plots.plotlyjs()

# ## Background

Expand Down
1 change: 1 addition & 0 deletions docs/src/tutorials/conic/ellipse_approx.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import Plots
import Random
import SCS
import Test #src
Plots.plotlyjs()

# ## Data

Expand Down
1 change: 1 addition & 0 deletions docs/src/tutorials/conic/min_ellipse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import LinearAlgebra
import Plots
import SCS
import Test #src
Plots.plotlyjs()

# ## Data

Expand Down
27 changes: 14 additions & 13 deletions docs/src/tutorials/conic/simple_examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Plots
import Random
import SCS
import Test
Plots.plotlyjs()

# ## Maximum cut via SDP

Expand All @@ -32,7 +33,7 @@ import Test
# where ``L`` is the weighted graph Laplacian and ``e`` is a vector of ones.
# For more details, see:
#
# Goemans, M. X., & Williamson, D. P. (1995).
# Goemans, M. X., & Williamson, D. P. (1995).
# [_Improved approximation algorithms for maximum cut and satisfiability problems
# using semidefinite programming._](https://doi.org/10.1145/227683.227684)
# Journal of the ACM (JACM), 42(6), 1115-1145.
Expand Down Expand Up @@ -122,7 +123,7 @@ S, T = solve_max_cut_sdp([0 1 5 0; 1 0 0 9; 5 0 0 2; 0 9 2 0])
# Given a set of points ``a_1, \ldots, a_m`` in ``\mathbb{R}^n``, allocate them to ``k`` clusters.
#
# For more details, see:
#
#
# Peng, J., & Wei, Y. (2007).
# [_Approximating k-means-type clustering via semidefinite programming_](https://doi.org/10.1137/050641983).
# SIAM Journal on Optimization, 18(1), 186-205.
Expand Down Expand Up @@ -179,7 +180,7 @@ example_k_means_clustering()
# \begin{bmatrix}
# 1 & ρ_{AB} & ρ_{AC} \\
# ρ_{AB} & 1 & ρ_{BC} \\
# ρ_{AC} & ρ_{BC} & 1
# ρ_{AC} & ρ_{BC} & 1
# \end{bmatrix} \succeq 0
# ```

Expand Down Expand Up @@ -250,16 +251,16 @@ example_correlation_problem()
# ```math
# D[a, b]^2 \leq Q[a, a] + Q[b, b] - 2 Q[a, b] \leq c^2 \; D[a, b]^2
# ```
# for all edges ``(a, b)`` in the graph and minimize ``c^2``,
# for all edges ``(a, b)`` in the graph and minimize ``c^2``,
# which gives us the SDP formulation below.
# Since we may choose any point to be the origin, we fix the first vertex at 0.
#
# For more details, see:
#
# J. Matoušek (2002), [_Lectures on discrete geometry_](https://doi.org/10.1007/978-1-4613-0039-7),
# Springer, pp. 378-379
#
# N. Linial (2002),
#
# N. Linial (2002),
# _[Finite metric spaces--combinatorics, geometry and algorithms](https://arxiv.org/abs/math/0304466)_,
# Proceedings of the ICM, Vol. 3, 573-586

Expand Down Expand Up @@ -318,11 +319,11 @@ example_minimum_distortion()
# Consider the pentagon graph:
# ```raw
# [5]
# / \
# / \
# / \
# / \
# [1] [4]
# | |
# | |
# | |
# [2] --- [3]
# ```
# with five vertices and edges. Its Lovász number is known to be precisely
Expand All @@ -334,7 +335,7 @@ example_minimum_distortion()
# matrix with entries ``(i,j)`` and ``(j,i)`` equal to 1, with all other entries 0.
# Let ``E`` be the graph's edge set; in this example, ``E`` contains
# (1,2), (2,3), (3,4), (4,5), (5,1)
# and their transposes. The Lovász number can be computed from the program
# and their transposes. The Lovász number can be computed from the program
# ```math
# \begin{align}
# \text{max} & \quad J • X & \\
Expand All @@ -351,8 +352,8 @@ example_minimum_distortion()
# A course in convexity,
# American Mathematical Society (Vol. 54), pp. 182-185.
#
# Knuth, D. E. (1994),
# [_The sandwich theorem_](https://doi.org/10.37236%2F1193),
# Knuth, D. E. (1994),
# [_The sandwich theorem_](https://doi.org/10.37236%2F1193),
# Electronic Journal of Combinatorics, Volume 1, Issue 1, A1.

function example_theta_problem()
Expand Down Expand Up @@ -389,7 +390,7 @@ example_theta_problem()
# Closed-form expressions for the optimal value are available.
# For more details, see:

# Bertsimas, D., Gupta, V., & Kallus, N. (2018).
# Bertsimas, D., Gupta, V., & Kallus, N. (2018).
# [_Data-driven robust optimization._](https://doi.org/10.1007/s10107-017-1125-8)
# Mathematical Programming, 167, 235-292.

Expand Down
1 change: 1 addition & 0 deletions docs/src/tutorials/linear/facility_location.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import HiGHS
import LinearAlgebra
import Plots
import Random
Plots.plotlyjs()

# ## Uncapacitated facility location

Expand Down
1 change: 1 addition & 0 deletions docs/src/tutorials/linear/factory_schedule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import DataFrames
import HiGHS
import StatsPlots
import Test #src
Plots.plotlyjs()

# ## Formulation

Expand Down
1 change: 1 addition & 0 deletions docs/src/tutorials/linear/multi_objective_knapsack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import HiGHS
import MultiObjectiveAlgorithms as MOA
import Plots
import Test #hide
Plots.plotlyjs()

# [MultiObjectiveAlgorithms.jl](@ref) is a package which implements a variety of
# algorithms for solving multi-objective optimization problems. Because it is a
Expand Down
1 change: 1 addition & 0 deletions docs/src/tutorials/linear/piecewise_linear.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using JuMP
import HiGHS
import Plots
Plots.plotlyjs()

# ## Minimizing a convex function (outer approximation)

Expand Down
1 change: 1 addition & 0 deletions docs/src/tutorials/nonlinear/classifiers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import LinearAlgebra
import Plots
import Random
import Test #src
Plots.plotlyjs()

# ## Data and visualisation

Expand Down
1 change: 1 addition & 0 deletions docs/src/tutorials/nonlinear/portfolio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import MultiObjectiveAlgorithms as MOA
import Plots
import Statistics
import StatsPlots
Plots.plotlyjs()

# ## Formulation

Expand Down
1 change: 1 addition & 0 deletions docs/src/tutorials/nonlinear/rocket_control.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using JuMP
import Ipopt
import Plots
Plots.plotlyjs()

# ## Overview

Expand Down

0 comments on commit e868731

Please sign in to comment.