import("methods")

importFrom("stats",
           "as.formula",
           "reorder")

importFrom("utils",
           "modifyList")

importFrom("parallel",
           "mclapply",
           "parLapply",
           "detectCores")

import("grDevices")##needed by RColorBrewer

importFrom("RColorBrewer",
           "brewer.pal")

importFrom("viridisLite",
           "viridis",
           "magma",
           "inferno",
           "plasma")

importFrom("grid",
           "gpar",
           "viewport",
           "polygonGrob",
           "linesGrob", "segmentsGrob", "textGrob",
           "grid.layout", "frameGrob",
           "placeGrob", "packGrob",
           "grobHeight", "grobWidth",
           "grid.locator", "arrow",
           "convertX", "convertY",
           "unit")

import("lattice")

importFrom("latticeExtra",
           "horizonplot",
           "xyplot.list",
           "layer", "glayer",
           "custom.theme",
           "custom.theme.2",
           "xscale.components.subticks",
           "yscale.components.subticks"
           )

importFrom("hexbin",
           "BTC",
           "panel.hexbinplot",
           "hexbinplot")


importClassesFrom("sp", "SpatialPoints")
importFrom("sp",
           "SpatialPoints",
           "SpatialPointsDataFrame",
           "degreeLabelsNS",
           "degreeLabelsEW",
           "coordinates",
           "CRS",
           "point.in.polygon")

importFrom("zoo",
           "zoo")##,
           ##xyplot)

import("raster")

export(
  'chooseRegion',
  'xyLayer',
  'rasterTheme',
  'YlOrRdTheme',
  'BTCTheme',
  'GrTheme',
  'RdBuTheme',
  'BuRdTheme',
  'PuOrTheme',
  'viridisTheme',
  'magmaTheme',
  'infernoTheme',
  'plasmaTheme',
  'streamTheme',
  'xscale.raster',
  'yscale.raster',
  'xscale.raster.subticks',
  'yscale.raster.subticks'
    )

exportMethods(
              "bwplot",
              "densityplot",
              "histogram",
              "horizonplot",
              "hovmoller",
              "identifyRaster",
              "levelplot",
              "contourplot",
              "vectorplot",
              "streamplot",
              "splom",
              "xyplot",
              "hexbinplot",
              "plot3D",
              "gplot"
              )
