visualDefault.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. /**
  20. * @file Visual mapping.
  21. */
  22. import * as zrUtil from 'zrender/src/core/util';
  23. var visualDefault = {
  24. /**
  25. * @public
  26. */
  27. get: function (visualType, key, isCategory) {
  28. var value = zrUtil.clone(
  29. (defaultOption[visualType] || {})[key]
  30. );
  31. return isCategory
  32. ? (zrUtil.isArray(value) ? value[value.length - 1] : value)
  33. : value;
  34. }
  35. };
  36. var defaultOption = {
  37. color: {
  38. active: ['#006edd', '#e0ffff'],
  39. inactive: ['rgba(0,0,0,0)']
  40. },
  41. colorHue: {
  42. active: [0, 360],
  43. inactive: [0, 0]
  44. },
  45. colorSaturation: {
  46. active: [0.3, 1],
  47. inactive: [0, 0]
  48. },
  49. colorLightness: {
  50. active: [0.9, 0.5],
  51. inactive: [0, 0]
  52. },
  53. colorAlpha: {
  54. active: [0.3, 1],
  55. inactive: [0, 0]
  56. },
  57. opacity: {
  58. active: [0.3, 1],
  59. inactive: [0, 0]
  60. },
  61. symbol: {
  62. active: ['circle', 'roundRect', 'diamond'],
  63. inactive: ['none']
  64. },
  65. symbolSize: {
  66. active: [10, 50],
  67. inactive: [0, 0]
  68. }
  69. };
  70. export default visualDefault;