data_validator.js 664 B

123456789101112131415161718192021222324
  1. /**
  2. * DevExtreme (viz/sankey/data_validator.js)
  3. * Version: 19.1.16
  4. * Build date: Tue Oct 18 2022
  5. *
  6. * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
  7. * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
  8. */
  9. "use strict";
  10. var graphModule = require("./graph");
  11. var validator = {
  12. validate: function(data, incidentOccurred) {
  13. var result = null;
  14. if (this._hasCycle(data)) {
  15. result = "E2006";
  16. incidentOccurred("E2006")
  17. }
  18. return result
  19. },
  20. _hasCycle: function(data) {
  21. return graphModule.struct.hasCycle(data)
  22. }
  23. };
  24. module.exports = validator;