Skip to content

Merging layout scale doesn't work when categories are sorted once #687

@greimel

Description

@greimel

Steps to reproduce

let
	n = 20
	tbl = (; x = rand(n), y = rand(n), grp = rand(["a", "b"], n))

	data(tbl) * mapping(:x, :y,
	    layout = :grp, # VERSION A (works)
	    # layout = :grp => sorter("a", "b"), # VERSION B (errors)
	 ) * visual(Scatter) + mapping(0.5, layout = "b") * visual(VLines) |> draw
end

Error reporting (VERSION B)

MethodError: no method matching isless(::AlgebraOfGraphics.Sorted{String}, ::String)

The function `isless` exists, but no method is defined for this combination of argument types.



Closest candidates are:

  isless(::Missing, ::Any)

   @ Base missing.jl:87

  isless(::Any, ::Missing)

   @ Base missing.jl:88

  isless(::AlgebraOfGraphics.Sorted, ::AlgebraOfGraphics.Sorted)

   @ AlgebraOfGraphics ~/.julia/packages/AlgebraOfGraphics/2kYB2/src/helpers.jl:16

  ...

Images (VERSION A)

Image

Version info

Julia Version 1.11.6
Commit 9615af0f269 (2025-07-09 12:58 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin24.0.0)
  CPU: 11 × Apple M3 Pro
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m2)
Threads: 5 default, 0 interactive, 2 GC (on 5 virtual cores)
Environment:
  JULIA_REVISE_WORKER_ONLY = 1
  [cbdf2221] AlgebraOfGraphics v0.11.7
  [336ed68f] CSV v0.10.15
  [13f3f980] CairoMakie v0.15.6
  [324d7699] CategoricalArrays v1.0.1
  [8be319e6] Chain v1.0.0
  [75880514] DataFrameMacros v0.4.1
  [a93c6f00] DataFrames v1.7.1
  [0703355e] DimensionalData v0.29.23
  [0ff47ea0] PlutoLinks v0.1.6
  [7f904dfe] PlutoUI v0.7.71
  [10745b16] Statistics v1.11.1
  [9c32591e] Poppler_jll v24.6.0+0
  [d7dd28d6] tectonic_jll v0.15.0+0
  [44cfe95a] Pkg v1.11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions